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:
|