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. Boohoo for C++. Definition at line 131 of file MakeRandomTree.h. References TryRandomSplit(). Referenced by MakeRandomTree(), and Impala::Core::Feature::TestMakeRandomTree::testFindSplitWithSeed(). 00133 { 00134 int bestDim; 00135 double bestVal; 00136 double bestGain; 00137 TryRandomSplit(bestDim, bestVal, bestGain, data, filter, nrClasses); 00138 for(int i=1 ; i<nrTrials ; ++i) 00139 { 00140 int dim; 00141 double val; 00142 double gain; 00143 TryRandomSplit(dim, val, gain, data, filter, nrClasses); 00144 if(gain > bestGain) 00145 { 00146 bestGain = gain; 00147 bestVal = val; 00148 bestDim = dim; 00149 } 00150 } 00151 dimension = bestDim; 00152 value = bestVal; 00153 }
Here is the call graph for this function:
|