fixed problem with surrogate splits in decision trees training

This commit is contained in:
Maria Dimashova 2010-09-22 06:55:51 +00:00
parent 2f3f677ffe
commit 0c771221a3
2 changed files with 5 additions and 4 deletions

View File

@ -418,8 +418,8 @@ void CvERTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
"variable (=%g) is too large", i, vi, val ); "variable (=%g) is too large", i, vi, val );
CV_ERROR( CV_StsBadArg, err ); CV_ERROR( CV_StsBadArg, err );
} }
num_valid++;
} }
num_valid++;
} }
} }
if( vi < var_count ) if( vi < var_count )

View File

@ -528,8 +528,9 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
"variable (=%g) is too large", i, vi, val ); "variable (=%g) is too large", i, vi, val );
CV_ERROR( CV_StsBadArg, err ); CV_ERROR( CV_StsBadArg, err );
} }
num_valid++;
} }
num_valid++;
if (is_buf_16u) if (is_buf_16u)
udst[i] = (unsigned short)i; udst[i] = (unsigned short)i;
else else
@ -538,9 +539,9 @@ void CvDTreeTrainData::set_data( const CvMat* _train_data, int _tflag,
} }
if (is_buf_16u) if (is_buf_16u)
icvSortUShAux( udst, num_valid, _fdst); icvSortUShAux( udst, sample_count, _fdst);
else else
icvSortIntAux( idst, /*or num_valid?\*/ sample_count, _fdst ); icvSortIntAux( idst, sample_count, _fdst );
} }
if( vi < var_count ) if( vi < var_count )