vigra - RandomForest< FEATURES, LABELS, SPLITTESTS, ACCTYPE > Class Template Reference

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

| RandomForest< FEATURES, LABELS, SPLITTESTS, ACCTYPE > Class Template Reference |

Random forest version 3. More...

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

## Public Member Functions
template<typename IDS >
double | leaf_ids (FEATURES const &features, IDS &ids, int n_threads=-1, const std::vector< size_t > tree_indices=std::vector< size_t >()) const
| For each data point in features, compute the corresponding leaf ids and return the average number of split comparisons. More...
void | merge (RandomForest const &other)
| Grow this forest by incorporating the other.
size_t | num_classes () const
| Return the number of classes.
size_t | num_features () const
| Return the number of classes.
size_t | num_nodes () const
| Return the number of nodes.
size_t | num_trees () const
| Return the number of trees.
void | predict (FEATURES const &features, LABELS &labels, int n_threads=-1, const std::vector< size_t > &tree_indices=std::vector< size_t >()) const
| Predict the given data and return the average number of split comparisons. More...
template<typename PROBS >
void | predict_probabilities (FEATURES const &features, PROBS &probs, int n_threads=-1, const std::vector< size_t > &tree_indices=std::vector< size_t >()) const
| Predict the probabilities of the given data and return the average number of split comparisons. More...

## Public Attributes
Graph | graph_
| The graph structure.
NodeMap< AccInputType >::type | node_responses_
| Contains the responses of each node (for example the most frequent label).
RandomForestOptions | options_
| The options that were used for training.
ProblemSpec< LabelType > | problem_spec_
| The specifications.
NodeMap< SplitTests >::type | split_tests_
| Contains a test for each internal node, that is used to determine whether given data goes to the left or the right child.

## Detailed Description

### template<typename FEATURES, typename LABELS, typename SPLITTESTS = LessEqualSplitTest<typename FEATURES::value_type>, typename ACCTYPE = ArgMaxVectorAcc<double>>
class vigra::rf3::RandomForest< FEATURES, LABELS, SPLITTESTS, ACCTYPE >

Random forest version 3.

vigra::rf3::RandomForest is typicall constructed via the factory function vigra::rf3::random_forest().

## Member Function Documentation

void predict | ( | FEATURES const & | features,
|  | LABELS & | labels,
|  | int | n_threads = `-1`,
|  | const std::vector< size_t > & | tree_indices = `std::vector<size_t>()`
| ) |  | const

Predict the given data and return the average number of split comparisons.

Note
  labels must be a 1-D array with size `features.shape(0)`.

void predict_probabilities | ( | FEATURES const & | features,
|  | PROBS & | probs,
|  | int | n_threads = `-1`,
|  | const std::vector< size_t > & | tree_indices = `std::vector<size_t>()`
| ) |  | const

Predict the probabilities of the given data and return the average number of split comparisons.

Note
  probs should have the shape (features.shape()[0], num_classes).

double leaf_ids | ( | FEATURES const & | features,
|  | IDS & | ids,
|  | int | n_threads = `-1`,
|  | const std::vector< size_t > | tree_indices = `std::vector<size_t>()`
| ) |  | const

For each data point in features, compute the corresponding leaf ids and return the average number of split comparisons.

Note
  ids should have the shape (features.shape()[0], num_trees).

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

- vigra/random_forest_3/random_forest.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 (Fri May 19 2017)