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

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

Take a random split point and return it and it's gain in the first three reference parameters.

Definition at line 105 of file MakeRandomTree.h.

References Impala::Util::Count(), Gain(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::Get1(), Impala::Core::Table::TableTem< Col1T, Col2T, Col3T, Col4T, Col5T, Col6T, Col7T, Col8T, Col9T >::GetColumn1(), Impala::Util::Random::GetInt(), Impala::Util::IndexOfNth(), Impala::Core::Table::Table::Size(), and SplitSet().

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

00108 {
00109     dimension = rng.GetInt(data->GetColumn1()->GetVectorLength(0));
00110     int n = Util::Count(filter, data->Size());
00111     int index;
00112     if(n==0)
00113         index = rng.GetInt(data->Size());
00114     else
00115         index = Util::IndexOfNth(filter, data->Size(), rng.GetInt(n));
00116     value = data->Get1(index)[dimension];
00117     bool* left = 0;
00118     bool* right = 0;
00119     SplitSet(left, right, dimension, value, data, filter);
00120     gain = Gain(data, nrClasses, left, right);
00121     delete left;
00122     delete right;
00123 }

Here is the call graph for this function:


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