fixed problem with surrogate splits in decision trees training

pull/13383/head
Maria Dimashova 14 years ago
parent 2f3f677ffe
commit 0c771221a3
  1. 2
      modules/ml/src/ertrees.cpp
  2. 7
      modules/ml/src/tree.cpp

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

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

Loading…
Cancel
Save