MCPcopy Create free account
hub / github.com/biometrics/openbr / predict

Method predict

openbr/core/boost.cpp:810–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

808//-------------------------------- CascadeBoostTree ----------------------------------------
809
810CvDTreeNode* CascadeBoostTree::predict( int sampleIdx ) const
811{
812 CvDTreeNode* node = root;
813 if( !node )
814 CV_Error( CV_StsError, "The tree has not been trained yet" );
815
816 if ( ((CascadeBoostTrainData*)data)->featureEvaluator->getMaxCatCount() == 0 ) // ordered
817 {
818 while( node->left )
819 {
820 CvDTreeSplit* split = node->split;
821 float val = ((CascadeBoostTrainData*)data)->getVarValue( split->var_idx, sampleIdx );
822 node = val <= split->ord.c ? node->left : node->right;
823 }
824 }
825 else // categorical
826 {
827 while( node->left )
828 {
829 CvDTreeSplit* split = node->split;
830 int c = (int)((CascadeBoostTrainData*)data)->getVarValue( split->var_idx, sampleIdx );
831 node = CV_DTREE_CAT_DIR(c, split->subset) < 0 ? node->left : node->right;
832 }
833 }
834 return node;
835}
836
837void CascadeBoostTree::split_node_data( CvDTreeNode* node )
838{

Callers 8

update_weightsMethod · 0.80
compareFunction · 0.80
projectMethod · 0.80
ForestTransformClass · 0.80
projectMethod · 0.80
projectMethod · 0.80
AdaBoostTransformClass · 0.80
BR_PROPERTYMethod · 0.80

Calls 2

getMaxCatCountMethod · 0.80
getVarValueMethod · 0.80

Tested by

no test coverage detected