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

RFVisitorBase Class Reference

Base class from which all random forest visitors derive. More...

#include <vigra/random_forest_3/random_forest_visitors.hxx>

Inheritance diagram for RFVisitorBase:
OOBError RFStopVisiting VariableImportance

Public Member Functions

void activate ()
 Activate the visitor.
 
void deactivate ()
 Deactivate the visitor.
 
bool is_active () const
 Return whether the visitor is active or not.
 
template<typename TREE , typename FEATURES , typename LABELS , typename WEIGHTS , typename SCORER , typename ITER >
void visit_after_split (TREE &, FEATURES &, LABELS &, WEIGHTS &, SCORER &, ITER, ITER, ITER)
 Do something after the split was made.
 
template<typename VISITORS , typename RF , typename FEATURES , typename LABELS >
void visit_after_training (VISITORS &, RF &, const FEATURES &, const LABELS &)
 Do something after all trees have been learned.
 
template<typename RF , typename FEATURES , typename LABELS , typename WEIGHTS >
void visit_after_tree (RF &, FEATURES &, LABELS &, WEIGHTS &)
 Do something after a tree has been learned.
 
void visit_before_training ()
 Do something before training starts.
 
template<typename TREE , typename FEATURES , typename LABELS , typename WEIGHTS >
void visit_before_tree (TREE &, FEATURES &, LABELS &, WEIGHTS &)
 Do something before a tree has been learned.
 

Detailed Description

Base class from which all random forest visitors derive.

Due to the parallel training, we cannot simply use a single visitor for all trees. Instead, each tree gets a copy of the original visitor.

The random forest training with visitors looks as follows:

  • Do the random forest preprocessing (translate labels to 0, 1, 2, ...).
  • Call visit_at_beginning() on the original visitor.
  • For each tree:
  • - Copy the original visitor and give the copy to the tree.
  • - Do the preprocessing (create the bootstrap sample, assign weights to the data points, ...).
  • - Call visit_before_tree() on the visitor copy.
  • - Do the node splitting until the tree is fully trained.
  • - Call visit_after_tree() on the visitor copy.
  • Call visit_at_end (which gets a vector with pointers to the visitor copies) on the original visitor.

Member Function Documentation

◆ visit_after_training()

template<typename VISITORS , typename RF , typename FEATURES , typename LABELS >
void visit_after_training ( VISITORS & ,
RF & ,
const FEATURES & ,
const LABELS &  )

Do something after all trees have been learned.

Parameters
vvector with pointers to the visitor copies
rfthe trained random forest

◆ visit_before_tree()

template<typename TREE , typename FEATURES , typename LABELS , typename WEIGHTS >
void visit_before_tree ( TREE & ,
FEATURES & ,
LABELS & ,
WEIGHTS &  )

Do something before a tree has been learned.

Parameters
weightsthe actual instance weights (after bootstrap sampling and class weights)

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