mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
GBT train/test was added to tree_engine sample
This commit is contained in:
parent
1b1eab8e67
commit
0f7c2e016d
@ -37,6 +37,7 @@ int main()
|
||||
CvBoost boost;
|
||||
CvRTrees rtrees;
|
||||
CvERTrees ertrees;
|
||||
CvGBTrees gbtrees;
|
||||
|
||||
CvMLData data;
|
||||
|
||||
@ -71,6 +72,10 @@ int main()
|
||||
printf("======ERTREES=====\n");
|
||||
ertrees.train( &data, CvRTParams( 10, 2, 0, false, 16, 0, true, 0, 100, 0, CV_TERMCRIT_ITER ));
|
||||
print_result( ertrees.calc_error( &data, CV_TRAIN_ERROR), ertrees.calc_error( &data, CV_TEST_ERROR ), ertrees.get_var_importance() );
|
||||
|
||||
printf("======GBTREES=====\n");
|
||||
gbtrees.train( &data, CvGBTreesParams(CvGBTrees::DEVIANCE_LOSS, 100, 0.05f, 0.6f, 10, true));
|
||||
print_result( gbtrees.calc_error( &data, CV_TRAIN_ERROR), gbtrees.calc_error( &data, CV_TEST_ERROR ), 0 );
|
||||
}
|
||||
else
|
||||
printf("File can not be read");
|
||||
|
Loading…
Reference in New Issue
Block a user