Creating an "unclassified" class in Random Forest I am trying to classify satellite based images by creating a region of interest and then classifying according to it.
I am using a Jupyter notebook using python to do that.
I used a Random forest classifier and got a nice model and result, but the problem is that the image is &quot;over classified&quot; meaning that all the pixels et value and force to be classified.
I would like to define level of similarity that a pixel has to have in order to be classified, otherwise, it will not get any class.
For example, the black suppose to be asphalt:

However, in the RGB, you can see it's not asphalt:

Is there any way to define in random forest or any other algorithm &quot;level os similarity&quot;? (For example something similar to n-D angle to match pixels to reference like ised in SAM, but under random forest, or another algorithm that allows define that)
SAM- https://www.harrisgeospatial.com/docs/SpectralAngleMapper.html
My end goal: to get &quot;unclassified&quot; values based on similarity level to the calibration data
It seems you can use RandomForest to get probabilities of being in both class by using predict_proba(X).
You could just get thoses probs, get the higher one (which is currently the class assigned to your data), and manually set a threshold, for example setting that if the most probable class is at less than 75%, then you manually classifies it as &quot;Unknown&quot;