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

void Impala::Core::Feature::FindSplit ( int &  dimension,
double &  value,
const AnnotatedFeatureTable *  data,
bool *  filter,
int  nrClasses,
int  nrTrials,
Util::Random &  rng 
)

Find a split by trying random splits and returning the one with the maximum gain.

Actually this function is just 'Optimise' or 'PickBest'. Ideally this would be a function that would taka another function as it's argument (TryRandoSplit). But because of TryRandomSplits three return arguments and C++'s type system this won't work.

Definition at line 132 of file MakeRandomTree.h.

References TryRandomSplit().

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

00135 {
00136     int bestDim;
00137     double bestVal;
00138     double bestGain;
00139     TryRandomSplit(bestDim, bestVal, bestGain, data, filter, nrClasses, rng);
00140     for(int i=1 ; i<nrTrials ; ++i)
00141     {
00142         int dim;
00143         double val;
00144         double gain;
00145         TryRandomSplit(dim, val, gain, data, filter, nrClasses, rng);
00146         if(gain > bestGain)
00147         {
00148             bestGain = gain;
00149             bestVal = val;
00150             bestDim = dim;
00151         }
00152     }
00153     dimension = bestDim;
00154     value = bestVal;
00155 }

Here is the call graph for this function:


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