我正在为 16 类问题使用决策树。我将参数设置为
CvDTreeParams params = CvDTreeParams(50, // max depth
100,// min sample count
0, // regression accuracy: N/A here
true, // compute surrogate split, no missing data
16, // max number of categories (use sub-optimal algorithm for larger numbers)
5, // the number of cross-validation folds
false, // use 1SE rule => smaller tree
false, // throw away the pruned tree branches
priors // the array of priors
);
CvDTree* dtree = new CvDTree();
dtree->train(data, CV_ROW_SAMPLE, classes,
Mat(), Mat(), var_type, Mat(), params);
但生成的树最多只给出 25 个深度。它没有增加深度。我在 Matlab 上尝试了相同的数据,树深度为 50。OpenCV 中的树深度有什么限制吗?