if( idx_selected == 0 )
CV_ERROR( CV_StsOutOfRange, "No components/input_variables is selected!" );
- //if( idx_selected == idx_total )
- // EXIT;
break;
case CV_32SC1:
// idx_arr is array of integer indices of selected components
CvMat* isubsample_idx = 0;
CvMat* subsample_co = 0;
+ bool isMakeRootCopy = true;
+
CV_FUNCNAME( "CvDTreeTrainData::subsample_data" );
__BEGIN__;
CV_ERROR( CV_StsError, "No training data has been set" );
if( _subsample_idx )
+ {
CV_CALL( isubsample_idx = cvPreprocessIndexArray( _subsample_idx, sample_count ));
- if( !isubsample_idx )
+ if( isubsample_idx->cols + isubsample_idx->rows - 1 == sample_count )
+ {
+ const int* sidx = isubsample_idx->data.i;
+ for( int i = 0; i < sample_count; i++ )
+ {
+ if( sidx[i] != i )
+ {
+ isMakeRootCopy = false;
+ break;
+ }
+ }
+ }
+ else
+ isMakeRootCopy = false;
+ }
+
+ if( isMakeRootCopy )
{
// make a copy of the root node
CvDTreeNode temp;
CV_CALL( try_split_node(root));
if( data->params.cv_folds > 0 )
- CV_CALL( prune_cv());
+ CV_CALL( prune_cv() );
if( !data->shared )
data->free_train_data();
CV_AMLTest amldtree( CV_DTREE, "adtree" );\r
CV_AMLTest amlboost( CV_BOOST, "aboost" );\r
CV_AMLTest amlrtrees( CV_RTREES, "artrees" );\r
-//CV_AMLTest amlertrees( CV_ERTREES, "aertrees" );\r
+CV_AMLTest amlertrees( CV_ERTREES, "aertrees" );\r
\r
/* End of file. */\r