Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Feature::RandomTree* Impala::Core::Feature::MakeRandomTree ( const AnnotatedFeatureTable *  data,
bool *  filter,
int  nrClasses,
int  maxDepth,
int  nrTrials 
)

recursive funtion finds a split and calls itself for the 'left' and 'right' splits

Definition at line 169 of file MakeRandomTree.h.

References Impala::Util::Count(), FindSplit(), GetCodeWord(), ILOG_FUNCTION, ILOG_PROGRESS, Impala::Core::Table::Table::Size(), and SplitSet().

Referenced by MakeRandomTree(), Impala::Core::Feature::TestMakeRandomTree::ReferenceTest(), and Impala::Core::Feature::TestMakeRandomTree::testTopLevel().

00171 {
00172     ILOG_FUNCTION(MakeRandomTree);
00173     if(maxDepth <= 0)
00174     {
00175         int code = GetCodeWord();
00176         ILOG_PROGRESS("code word "<< code, 4.);
00177         return new RandomTree(code, Util::Count(filter, data->Size()));
00178     }
00179     
00180     // find dimension and value to split on
00181     int dimension;
00182     double value;
00183     FindSplit(dimension, value, data, filter, nrClasses, nrTrials);
00184     // construct filters for the left and right child
00185     bool* leftFilter=0;
00186     bool* rightFilter=0;
00187     SplitSet(leftFilter, rightFilter, dimension, value, data, filter);
00188     // make sub trees
00189     RandomTree* left =
00190         MakeRandomTree(data, leftFilter, nrClasses, maxDepth-1, nrTrials);
00191     RandomTree* right =
00192         MakeRandomTree(data, rightFilter, nrClasses, maxDepth-1, nrTrials);
00193     delete leftFilter;
00194     delete rightFilter;
00195     return new RandomTree(dimension, value, left, right);
00196 }

Here is the call graph for this function:


Generated on Fri Mar 19 11:08:22 2010 for ImpalaSrc by  doxygen 1.5.1