[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

Classes | Namespaces
Machine Learning

Classes

class  RandomForest< LabelType, PreprocessorTag >
class  RandomForestOptions
 Options object for the random forest. More...

Namespaces

namespace  vigra::detail

Learning

Following functions differ in the degree of customization allowed

template<class U , class C1 , class U2 , class C2 , class Split_t , class Stop_t , class Visitor_t , class Random_t >
double onlineLearn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &response, int new_start_index, Visitor_t visitor_, Split_t split_, Stop_t stop_, Random_t &random, bool adjust_thresholds=false)
template<class U , class C1 , class U2 , class C2 , class Split_t , class Stop_t , class Visitor_t , class Random_t >
void reLearnTree (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &response, int treeId, Visitor_t visitor_, Split_t split_, Stop_t stop_, Random_t &random)
template<class U , class C1 , class U2 , class C2 , class Split_t , class Stop_t , class Visitor_t , class Random_t >
double learn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &response, Visitor_t visitor, Split_t split, Stop_t stop, Random_t const &random)
 learn on data with custom config and random number generator
template<class U , class C1 , class U2 , class C2 , class Split_t , class Stop_t , class Visitor_t >
double learn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &response, Visitor_t visitor, Split_t split, Stop_t stop)
template<class U , class C1 , class U2 , class C2 >
double onlineLearn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &labels, int new_start_index, bool adjust_thresholds=false)
template<class U , class C1 , class U2 , class C2 >
void reLearnTree (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &labels, int treeId)
template<class U , class C1 , class U2 , class C2 , class Visitor_t >
double learn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &labels, Visitor_t visitor)
template<class U , class C1 , class U2 , class C2 , class Visitor_t , class Split_t >
double learn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &labels, Visitor_t visitor, Split_t split)
template<class U , class C1 , class U2 , class C2 >
double learn (MultiArrayView< 2, U, C1 > const &features, MultiArrayView< 2, U2, C2 > const &labels)
 learn on data with default configuration

prediction

template<class U , class C , class Stop >
LabelType predictLabel (MultiArrayView< 2, U, C >const &features, Stop &stop) const
 predict a label given a feature.
template<class U , class C >
LabelType predictLabel (MultiArrayView< 2, U, C > const &features, ArrayVectorView< double > prior) const
 predict a label with features and class priors
template<class T1 , class T2 , class C >
void predictProbabilities (OnlinePredictionSet< T1 > &predictionSet, MultiArrayView< 2, T2, C > &prob)
template<class U , class C1 , class T , class C2 >
void predictProbabilities (MultiArrayView< 2, U, C1 >const &features, MultiArrayView< 2, T, C2 > &prob) const
 predict the class probabilities for multiple labels
template<class U , class C >
LabelType predictLabel (MultiArrayView< 2, U, C >const &features)
template<class U , class C1 , class T , class C2 >
void predictLabels (MultiArrayView< 2, U, C1 >const &features, MultiArrayView< 2, T, C2 > &labels) const
 predict multiple labels with given features
template<class U , class C1 , class T , class C2 , class Stop >
void predictLabels (MultiArrayView< 2, U, C1 >const &features, MultiArrayView< 2, T, C2 > &labels, Stop &stop) const
template<class U , class C1 , class T , class C2 , class Stop >
void predictProbabilities (MultiArrayView< 2, U, C1 >const &features, MultiArrayView< 2, T, C2 > &prob, Stop &stop) const
 predict the class probabilities for multiple labels

Detailed Description

This module provides classification algorithms that map features to labels or label probablities.


Function Documentation

void reLearnTree ( MultiArrayView< 2, U, C1 > const &  features,
MultiArrayView< 2, U2, C2 > const &  response,
int  treeId,
Visitor_t  visitor_,
Split_t  split_,
Stop_t  stop_,
Random_t &  random 
)

Todo:
replace this crappy class out. It uses function pointers. and is making code slower according to me. Comment from Nathan: This is copied from Rahul, so me=Rahul

double learn ( MultiArrayView< 2, U, C1 > const &  features,
MultiArrayView< 2, U2, C2 > const &  response,
Visitor_t  visitor,
Split_t  split,
Stop_t  stop,
Random_t const &  random 
)

learn on data with custom config and random number generator

Parameters:
featuresa N x M matrix containing N samples with M features
responsea N x D matrix containing the corresponding response. Current split functors assume D to be 1 and ignore any additional columns. This is not enforced to allow future support for uncertain labels, label independent strata etc. The Preprocessor specified during construction should be able to handle features and labels features and the labels.
See also:
SplitFunctor, Preprocessing
Parameters:
visitorvisitor which is to be applied after each split, tree and at the end. Use RF_Default for using default value.
See also:
visitor
Parameters:
splitsplit functor to be used to calculate each split use rf_default() for using default value.
stoppredicate to be used to calculate each split use rf_default() for using default value.
randomRandomNumberGenerator to be used. Use rf_default() to use default value.
Returns:
oob_error.
See also:
OOB_Visitor, VariableImportanceVisitor

Todo:
replace this crappy class out. It uses function pointers. and is making code slower according to me

LabelType predictLabel ( MultiArrayView< 2, U, C >const &  features,
Stop &  stop 
) const

predict a label given a feature.

Parameters:
features,:a 1 by featureCount matrix containing data point to be predicted (this only works in classification setting)
stop,:early stopping critierion
Returns:
double value representing class. You can use the predictLabels() function together with the rf.external_parameter().class_type_ attribute to get back the same type used during learning.
LabelType predictLabel ( MultiArrayView< 2, U, C > const &  features,
ArrayVectorView< double >  prior 
) const

predict a label with features and class priors

Parameters:
features,:same as above.
prior,:iterator to prior weighting of classes
Returns:
sam as above.
void predictProbabilities ( MultiArrayView< 2, U, C1 >const &  features,
MultiArrayView< 2, T, C2 > &  prob 
) const

predict the class probabilities for multiple labels

Parameters:
featuressame as above
proba n x class_count_ matrix. passed by reference to save class probabilities
double learn ( MultiArrayView< 2, U, C1 > const &  features,
MultiArrayView< 2, U2, C2 > const &  labels 
)

learn on data with default configuration

Parameters:
featuresa N x M matrix containing N samples with M features
labelsa N x D matrix containing the corresponding N labels. Current split functors assume D to be 1 and ignore any additional columns. this is not enforced to allow future support for uncertain labels.
Returns:
out of bag error estimate.

learning is done with:

See also:
GiniSplit, EarlyStoppingStd, OOB_Visitor
  • Randomly seeded random number generator
  • default gini split functor as described by Breiman
  • default The standard early stopping criterion
  • the oob visitor, whose value is returned.
void predictLabels ( MultiArrayView< 2, U, C1 >const &  features,
MultiArrayView< 2, T, C2 > &  labels 
) const

predict multiple labels with given features

Parameters:
features,:a n by featureCount matrix containing data point to be predicted (this only works in classification setting)
labels,:a n by 1 matrix passed by reference to store output.
void predictProbabilities ( MultiArrayView< 2, U, C1 >const &  features,
MultiArrayView< 2, T, C2 > &  prob,
Stop &  stop 
) const

predict the class probabilities for multiple labels

Parameters:
featuressame as above
proba n x class_count_ matrix. passed by reference to save class probabilities
stopearlystopping criterion
See also:
EarlyStopping

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.7.0 (Thu Aug 25 2011)