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

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

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

Definition at line 171 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().

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

Here is the call graph for this function:


Generated on Thu Jan 13 09:19:02 2011 for ImpalaSrc by  doxygen 1.5.1