fixed CvDTree and CvForestTree find_best_split() methods
This commit is contained in:
parent
8e38063965
commit
7d94f256e6
@ -158,8 +158,12 @@ CvDTreeSplit* CvForestTree::find_best_split( CvDTreeNode* node )
|
|||||||
|
|
||||||
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
|
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
|
||||||
|
|
||||||
CvDTreeSplit *bestSplit = data->new_split_cat( 0, -1.0f );
|
CvDTreeSplit *bestSplit = 0;
|
||||||
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
|
if( finder.bestSplit->quality > 0 )
|
||||||
|
{
|
||||||
|
bestSplit = data->new_split_cat( 0, -1.0f );
|
||||||
|
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
|
||||||
|
}
|
||||||
|
|
||||||
return bestSplit;
|
return bestSplit;
|
||||||
}
|
}
|
||||||
|
@ -1877,8 +1877,12 @@ CvDTreeSplit* CvDTree::find_best_split( CvDTreeNode* node )
|
|||||||
|
|
||||||
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
|
cv::parallel_reduce(cv::BlockedRange(0, data->var_count), finder);
|
||||||
|
|
||||||
CvDTreeSplit *bestSplit = data->new_split_cat( 0, -1.0f );
|
CvDTreeSplit *bestSplit = 0;
|
||||||
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
|
if( finder.bestSplit->quality > 0 )
|
||||||
|
{
|
||||||
|
bestSplit = data->new_split_cat( 0, -1.0f );
|
||||||
|
memcpy( bestSplit, finder.bestSplit, finder.splitSize );
|
||||||
|
}
|
||||||
|
|
||||||
return bestSplit;
|
return bestSplit;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user