cv::ml::RTrees variable importance

asked 2019-11-08 06:37:25 -0500

JoseAFern gravatar image

Hi

I am working with a random forest (cv::ml::rtrees) and would like a ranking of the features and, if possible, some weight to indicate their relative importance. I have seen that rtrees contains a getVarImportance method which returns a cv::mat with some values. Doing tests with a dataset, I have noticed that when I call this method I get a matrix with a value per feature, as expected. However, the values are all zero but one. I kind of expected a little more information. Is this what this method does or am I missing something here?

(Note: Yes, I have done setCalculateVarImportance(true) :))

edit retag flag offensive close merge delete

Comments

1

i know it's terrible hard, but if you could come up with a short, reproducable example (w. synthetic data) ?

berak gravatar imageberak ( 2019-11-08 07:07:03 -0500 )edit

Sorry, my bad - they were all correlated

JoseAFern gravatar imageJoseAFern ( 2019-11-11 02:58:57 -0500 )edit