Random Forest probability values

Hi,

I am following the below example for random forest (it is working quite well for a my case).

What I need additionally is to get the probability of each pixel classification. The classification scenario of machine learning models (random forest in this case) are usually estimating the probability of a being classified as a class.
Thus, in addition to a classified map (like 0 and 1 for a binary example), I want to export maps with probability values that random forest is calculating for each pixel.

Thanks,
Mohammad

Hi Mohammad,

Interesting suggestion. It is something we discussed internally before, but have no implementation for yet.

It is probably possible to implement in an UDF.

I logged a ticket, but it is not planned in yet: Implement predict_probabilities · Issue #775 · Open-EO/openeo-geopyspark-driver · GitHub

With a NoR support package it could get a higher priority.

Greetings,
Emile Sonneveld

Hi Emile,

Thanks for your consideration.
I hope it will be a solution for it.

Thanks,
Mohammad

Hi,

We also have an experimental catboost feature that should support probabilities. Would that be useful for you?

Emile

Hi Emile,

Can you please share with me the documentation of catboost?

Hi,

We don’t have documentation on it. But we have an advanced example where ONNX is used to run machine learning models. It is quite a standard library that supports probabilities

Training the model here (ONNX should support catboost and random_forest):
https://github.com/clausmichele/openEO_photovoltaic/blob/main/notebooks/rf_training.ipynb

ONNX conversion example:
https://github.com/HansVRP/openEO_photovoltaic/blob/hv_joboptionfix/udf_inference/openeo_pv_farms_onnxconversion.ipynb

Inference notebook:
https://github.com/HansVRP/openEO_photovoltaic/blob/hv_joboptionfix/udf_inference/openeo_pv_farms_inference_udf.ipynb

The actual UDF where you would want to adapt the apply_datacube:
https://github.com/HansVRP/openEO_photovoltaic/blob/hv_joboptionfix/udf_inference/udf_rf_onnx.py

We usually upload the model to our artifactory. But you can probably upload on your own filehost too.