TransWikia.com

Creating an "unclassified" class in Random Forest

Data Science Asked on October 30, 2020

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 "over classified" 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:

enter image description here

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

enter image description here

Is there any way to define in random forest or any other algorithm "level os similarity"? (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 "unclassified" values based on similarity level to the calibration data

One Answer

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 "Unknown"

Correct answer by BeamsAdept on October 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP