Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Max Categories, MaxDepth in Random Forest

Hi,

I was looking the Random Forest Classifier in Open CV. There are number of variables to set as per the examples I found. I was investigating Two Variables setMaxCategories(), and setMaxDepth(). In the class precomp.hpp, it seems there is an upper limitation i.e.:

inline void setMaxCategories(int val) { if( val < 2 ) CV_Error( CV_StsOutOfRange, "max_categories should be >= 2" ); maxCategories = std::min(val, 15 ); }

inline void setMaxDepth(int val) { if( val < 0 ) CV_Error( CV_StsOutOfRange, "max_depth should be >= 0" ); maxDepth = std::min( val, 25 ); }

In both cases std::min will return 15 and 25 regardless of the Max Categories and Max Depth is defined by a user. Documentation related to both does not indicate the logic or reason for the upper value.

Please guide me on this issue as in my case I want to use higher values for both but code always set it to the upper limit defined in the code.

Many thanks.

Maz

Max Categories, MaxDepth in Random Forest

Hi,

I was looking the Random Forest Classifier in Open CV. There are number of variables to set as per the examples I found. I was investigating Two Variables setMaxCategories(), and setMaxDepth(). In the class precomp.hpp, it seems there is an upper limitation i.e.:

inline void setMaxCategories(int val)
{
if( val < 2 )
CV_Error( CV_StsOutOfRange, "max_categories should be >= 2" );
maxCategories = std::min(val, 15 );
}

} inline void setMaxDepth(int val) { if( val < 0 ) CV_Error( CV_StsOutOfRange, "max_depth should be >= 0" ); maxDepth = std::min( val, 25 ); }

}

In both cases std::min will return 15 and 25 regardless of the Max Categories and Max Depth is defined by a user. Documentation related to both does not indicate the logic or reason for the upper value.

Please guide me on this issue as in my case I want to use higher values for both but code always set it to the upper limit defined in the code.

Many thanks.

Maz