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

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

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::IndexOfNth(), Impala::Util::RandomInt(), Impala::Core::Table::Table::Size(), and SplitSet().

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

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

Here is the call graph for this function:


Generated on Fri Mar 19 11:08:20 2010 for ImpalaSrc by  doxygen 1.5.1