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

| VariableImportance Class Reference |

Compute the variable importance. More...

`#include <vigra/random_forest_3/random_forest_visitors.hxx>`

Inheritance diagram for VariableImportance:

## Public Member Functions

template<typename TREE , typename FEATURES , typename LABELS , typename WEIGHTS , typename SCORER , typename ITER >
void | visit_after_split (TREE &tree, FEATURES &, LABELS &labels, WEIGHTS &weights, SCORER &scorer, ITER begin, ITER, ITER end)
template<typename VISITORS , typename RF , typename FEATURES , typename LABELS >
void | visit_after_training (VISITORS &visitors, RF &rf, const FEATURES &features, const LABELS &)
template<typename RF , typename FEATURES , typename LABELS , typename WEIGHTS >
void | visit_after_tree (RF &rf, const FEATURES &features, const LABELS &labels, WEIGHTS &)
template<typename TREE , typename FEATURES , typename LABELS , typename WEIGHTS >
void | visit_before_tree (TREE &tree, FEATURES &features, LABELS &, WEIGHTS &weights)
Public Member Functions inherited from RFVisitorBase
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. More...
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. More...

## Public Attributes

size_t | repetition_count_
MultiArray< 2, double > | variable_importance_

## Detailed Description

Compute the variable importance.

## Member Function Documentation

## ◆ visit_before_tree()

void visit_before_tree | ( | TREE & | tree,
|  | FEATURES & | features,
|  | LABELS & | ,
|  | WEIGHTS & | weights
| ) |  |

Resize the variable importance array and store in-bag / out-of-bag information.

## ◆ visit_after_split()

void visit_after_split | ( | TREE & | tree,
|  | FEATURES & | ,
|  | LABELS & | labels,
|  | WEIGHTS & | weights,
|  | SCORER & | scorer,
|  | ITER | begin,
|  | ITER | ,
|  | ITER | end
| ) |  |

Calculate the impurity decrease based variable importance after every split.

## ◆ visit_after_tree()

void visit_after_tree | ( | RF & | rf,
|  | const FEATURES & | features,
|  | const LABELS & | labels,
|  | WEIGHTS & |
| ) |  |

Compute the permutation importance.

## ◆ visit_after_training()

void visit_after_training | ( | VISITORS & | visitors,
|  | RF & | rf,
|  | const FEATURES & | features,
|  | const LABELS & |
| ) |  |

Accumulate the variable importances from the single trees.

## Member Data Documentation

## ◆ variable_importance_

MultiArray<2, double> variable_importance_

This Array has the same entries as the R - random forest variable importance. Matrix is featureCount by (classCount +2) variable_importance_(ii,jj) is the variable importance measure of the ii-th variable according to: jj = 0 - (classCount-1) classwise permutation importance jj = rowCount(variable_importance_) -2 permutation importance jj = rowCount(variable_importance_) -1 gini decrease importance.

permutation importance: The difference between the fraction of OOB samples classified correctly before and after permuting (randomizing) the ii-th column is calculated. The ii-th column is permuted rep_cnt times.

class wise permutation importance: same as permutation importance. We only look at those OOB samples whose response corresponds to class jj.

gini decrease importance: row ii corresponds to the sum of all gini decreases induced by variable ii in each node of the random forest.

## ◆ repetition_count_

size_t repetition_count_

how often the permutation takes place

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

- vigra/random_forest_3/random_forest_visitors.hxx

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