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

details Machine Learning VIGRA


Namespaces

namespace  vigra::detail

Classes

class  RandomForest
class  RandomForestOptions
 Options object for the random forest. More...

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 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, 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)

prediction

template<class U, class C>
LabelType predictLabel (MultiArrayView< 2, U, C >const &features)
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 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 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>
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 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
template<class T1, class T2, class C>
void predictProbabilities (OnlinePredictionSet< T1 > &predictionSet, MultiArrayView< 2, T2, C > &prob)


Detailed Description

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

Function Documentation

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 
) [inherited]

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

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 
) [inherited]

learn on data with custom config and random number generator

Parameters:
features a N x M matrix containing N samples with M features
response a 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:
visitor visitor which is to be applied after each split, tree and at the end. Use RF_Default for using default value.
See also:
visitor
Parameters:
split split functor to be used to calculate each split use rf_default() for using default value.
stop predicate to be used to calculate each split use rf_default() for using default value.
random RandomNumberGenerator 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

template<class U, class C, class Stop>
LabelType predictLabel ( MultiArrayView< 2, U, C >const &  features,
Stop &  stop 
) const [inherited]

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.

template<class U, class C>
LabelType predictLabel ( MultiArrayView< 2, U, C > const &  features,
ArrayVectorView< double >  prior 
) const [inherited]

predict a label with features and class priors

Parameters:
features,: same as above.
prior,: iterator to prior weighting of classes
Returns:
sam as above.

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_t &  stop 
) const [inherited]

predict the class probabilities for multiple labels

Parameters:
features same as above
prob a n x class_count_ matrix. passed by reference to save class probabilities
stop earlystopping criterion
See also:
EarlyStopping

template<class U, class C1, class T, class C2>
void predictProbabilities ( MultiArrayView< 2, U, C1 >const &  features,
MultiArrayView< 2, T, C2 > &  prob 
) const [inherited]

predict the class probabilities for multiple labels

Parameters:
features same as above
prob a n x class_count_ matrix. passed by reference to save class probabilities

template<class U, class C1, class T, class C2>
void predictLabels ( MultiArrayView< 2, U, C1 >const &  features,
MultiArrayView< 2, T, C2 > &  labels 
) const [inherited]

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.

© 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 (20 Apr 2010)