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

VisitorBase Class Reference

#include <vigra/random_forest/rf_visitors.hxx>

Inheritance diagram for VisitorBase:
ClusterImportanceVisitor CompleteOOBInfo CorrelationVisitor OOB_Error OOB_PerTreeError OnlineLearnVisitor RandomForestProgressVisitor StopVisiting VariableImportanceVisitor

Public Member Functions

double return_val ()
 
template<class Tree , class Split , class Region , class Feature_t , class Label_t >
void visit_after_split (Tree &tree, Split &split, Region &parent, Region &leftChild, Region &rightChild, Feature_t &features, Label_t &labels)
 
template<class RF , class PR , class SM , class ST >
void visit_after_tree (RF &rf, PR &pr, SM &sm, ST &st, int index)
 
template<class RF , class PR >
void visit_at_beginning (RF const &rf, PR const &pr)
 
template<class RF , class PR >
void visit_at_end (RF const &rf, PR const &pr)
 
template<class TR , class IntT , class TopT , class Feat >
void visit_external_node (TR &tr, IntT index, TopT node_t, Feat &features)
 
template<class TR , class IntT , class TopT , class Feat >
void visit_internal_node (TR &, IntT, TopT, Feat &)
 

Detailed Description

Base Class from which all Visitors derive. Can be used as a template to create new Visitors.

Member Function Documentation

◆ visit_after_split()

template<class Tree , class Split , class Region , class Feature_t , class Label_t >
void visit_after_split ( Tree & tree,
Split & split,
Region & parent,
Region & leftChild,
Region & rightChild,
Feature_t & features,
Label_t & labels )

do something after the the Split has decided how to process the Region (Stack entry)

Parameters
treereference to the tree that is currently being learned
splitreference to the split object
parentcurrent stack entry which was used to decide the split
leftChildleft stack entry that will be pushed
rightChildright stack entry that will be pushed.
featuresfeatures matrix
labelslabel matrix
See also
RF_Traits::StackEntry_t

◆ visit_after_tree()

template<class RF , class PR , class SM , class ST >
void visit_after_tree ( RF & rf,
PR & pr,
SM & sm,
ST & st,
int index )

do something after each tree has been learned

Parameters
rfreference to the random forest object that called this visitor
prreference to the preprocessor that processed the input
smreference to the sampler object
streference to the first stack entry
indexindex of current tree

◆ visit_at_end()

template<class RF , class PR >
void visit_at_end ( RF const & rf,
PR const & pr )

do something after all trees have been learned

Parameters
rfreference to the random forest object that called this visitor
prreference to the preprocessor that processed the input

◆ visit_at_beginning()

template<class RF , class PR >
void visit_at_beginning ( RF const & rf,
PR const & pr )

do something before learning starts

Parameters
rfreference to the random forest object that called this visitor
prreference to the Processor class used.

◆ visit_external_node()

template<class TR , class IntT , class TopT , class Feat >
void visit_external_node ( TR & tr,
IntT index,
TopT node_t,
Feat & features )

do some thing while traversing tree after it has been learned (external nodes)

Parameters
trreference to the tree object that called this visitor
indexindex in the topology_ array we currently are at
node_ttype of node we have (will be e_.... - )
featuresfeature matrix
See also
NodeTags;

you can create the node by using a switch on node_tag and using the corresponding Node objects. Or - if you do not care about the type use the NodeBase class.

◆ visit_internal_node()

template<class TR , class IntT , class TopT , class Feat >
void visit_internal_node ( TR & ,
IntT ,
TopT ,
Feat &  )

do something when visiting a internal node after it has been learned

See also
visit_external_node

◆ return_val()

double return_val ( )

return a double value. The value of the first visitor encountered that has a return value is returned with the RandomForest::learn() method - or -1.0 if no return value visitor existed. This functionality basically only exists so that the OOB - visitor can return the oob error rate like in the old version of the random forest.


The documentation for this class was generated from the following file:

© 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.12.2