Sorry for the confusing title, but it basically says it all. Here's the structures I'm using (found in OpenCV) :
struct CV_EXPORTS CvRTParams : public CvDTreeParams
{
bool calc_var_importance;
int nactive_vars;
CvTermCriteria term_crit;
CvRTParams() : CvDTreeParams( 5, 10, 0, false, 10, 0, false, false, 0 ),
calc_var_importance(false), nactive_vars(0)
{
term_crit = cvTermCriteria( CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 50, 0.1 );
}
}
and
typedef struct CvTermCriteria
{
int type;
int max_iter;
double epsilon;
}
CvTermCriteria;
CV_INLINE CvTermCriteria cvTermCriteria( int type, int max_iter, double epsilon )
{
CvTermCriteria t;
t.type = type;
t.max_iter = max_iter;
t.epsilon = (float)epsilon;
return t;
}
Now, I initialize a CvRTParams structure and set values for its members :
CvRTParams params;
params.max_depth = 8;
params.min_sample_count = 10;
params.regression_accuracy = 0;
params.use_surrogates = false;
params.max_categories = 10;
params.priors = priors;
params.calc_var_importance = true;
params.nactive_vars = 9;
params.term_crit.max_iter = 33;
params.term_crit.epsilon = 0.1;
params.term_crit.type = 3;
Then call a function of an object, taking params in as a parameter :
CvRTrees* rt = new CvRTrees;
rt->train(t, CV_ROW_SAMPLE, r, 0, 0, var_type, 0, params)
What happens now ? Values of...
params.term_crit.max_iter
params.term_crit.epsilon
params.term_crit.type
have changed ! They are no longer 33, 0.1 and 3, but something along the lines of 3, 7.05541e-313 and 4, and this, for the whole duration of the CvRtrees::train() function...