Apply Classifier model


HI All,

I have been using CP/CPA for some time now, but I’m still missing a piece of information about how the classification model works. If I understood well, I can save a classifier model and apply it on a new data set by the mean of “load classifier model”, only if I’m using Fast Gentle Boosting algorithm, is ir right? I’m often using Random Forest as it performs better, but I’m unable to apply the model generated from this method to a new set of images. Moreover, It’s not clear to me if the .model generated only comprises classification rules…or something else…

I often have a big batch problem with my images especially if I collect pictures in fluorescence, as fluorescence decay or other experimental flaws are often detrimental for a good reproducibility. So I must re-run the classification process based on a new training set for each sample But if I’m able to perfectly standardize the staining method, I will surely apply the rules of my first classification on all my samples. This “forecasting” method could be really useful and implemented.

So, my question is: is it true that it’s not possible to apply saved rules on new images sets? Is there any way to implement this new function?

I read some posts about this topic but it seems there has been no updates about it

Thank you very much for this beautiful software



It looks like from this bug thread the issue may be fixed if you’re running CPA from source, so if you can I’d try installing from source and giving that a try. If you do, it’d be great if you could update the GitHub issue with whether or not it now works for you!

Unfortunately we as a team have no official funding to keep CPA up-to-date, so while we do improve it as much as we can (because we love it) it is definitely slower compared to our ability to keep CP up-to-date.


Hi bcimini,

thank you very much for your suggestion. I tried to follow the instructions from this page here:, and from here:’s-version-installation-for-pc, to install from source both CP and CPA.

I’m not an expert, so I had to follow some tips on stack overflow to set the environment variables for Java development kit and java runtime environment on my PC (I’m running on windows) otherwise I could not properly install some python packages. Moreover I had to deal with some errors installing javabridge and python-bioformats created by Microsoft Visual Studio (e.g LINK : fatal error LNK1181: cannot open input file filename). In the end, I managed to run CPA from source and I was able to save a classifier.model using random forest for my classification. I also noticed some new features that are not available in the stable last stable version.

So happy? Not really, as from here on things became a bit messy…I was not able to install any CellProfiler version as there is no file in the new repository (version 3.0.1). I tried to use the old version 2.1.1 where the CellProfiler. py file is present but it did’t work, probably either because the old version is no more supported (the cmd shell failed to download some file required) or because I was not able to fix some errors mainly linked to the LINK settings in Visual Studio. Moreover, the new java environments variables that I had to set are not compatible with CP and CPA versions installed from the .exe files. So it came up that I could not use CPA installed from source and CP installed from an .exe file together. I rolled back to the stable versions of both programs (CP 2.2.0 and CPA 2.2.1) which work only if I erase the environments variables (JAVA_HOME) required to run CPA from source…

Is there a simple way to run CPA from source having CP installed from the stable .exe version (2.2.0 or 3.0)?
It could be really helpful if I could use the classifier model to train the system without having to build a new training set all the times…

I will update the GitHub issue in a minute…

thank you very much for your support and suggestions.