Random forests - variable importance in OTB


I am using the RF classifier within TrainVectorClassifier function in Monteverdi. Is it possible to calculate the variable importance?

I have read the documentation below, so it seems that I could return the variable importance array if the code is run through Python, but I am wondering if it is supported in OTB?

Many thanks,


Which documentation are you referring to ? OpenCV doc ?

Unfortunately, outputting the variable importance in TrainVectorClassifier is not possible.

But this should be easy to add, as we use the openCV training method internally in the application. I submitted a feature request on the gitlab for this functionality,


1 Like

Hi Cedric,

(Apologies - I thought I posted the URL but it didn’t work the first time.) I was referring to the opencv documentation, as I’d seen that OpenCV had the capability for calculating variable importance ( CvRTrees::getVarImportance) and was wondering if this element was implemented in OTB.

Thanks for raising the feature request - I think this would be an excellent addition to RF implementation in OTB.



Any news on this topic ? I would also be interested if the train image classifier could export the variable importance (GINI, for example).