Commit d38f6942 authored by Maria Dimashova's avatar Maria Dimashova

fixed CvBoost in mll if no tree can be trained.

parent 65e23506
...@@ -910,7 +910,7 @@ CvBoost::CvBoost() ...@@ -910,7 +910,7 @@ CvBoost::CvBoost()
void CvBoost::prune( CvSlice slice ) void CvBoost::prune( CvSlice slice )
{ {
if( weak ) if( weak && weak->total > 0 )
{ {
CvSeqReader reader; CvSeqReader reader;
int i, count = cvSliceLength( slice, weak ); int i, count = cvSliceLength( slice, weak );
...@@ -1076,11 +1076,15 @@ CvBoost::train( const CvMat* _train_data, int _tflag, ...@@ -1076,11 +1076,15 @@ CvBoost::train( const CvMat* _train_data, int _tflag,
break; break;
} }
get_active_vars(); // recompute active_vars* maps and condensed_idx's in the splits. if(weak->total > 0)
data->is_classifier = true; {
ok = true; get_active_vars(); // recompute active_vars* maps and condensed_idx's in the splits.
data->is_classifier = true;
data->free_train_data(); data->free_train_data();
ok = true;
}
else
clear();
__END__; __END__;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment