forpy 2

Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
forpy::RegressionLeaf Class Reference
Leafs

Manages the leaf nodes of regression trees. More...

`#include <regressionleaf.h>`

Inheritance diagram for forpy::RegressionLeaf:

## Public Member Functions
| RegressionLeaf (const bool &store_variance=false, const bool &summarize=false)
bool | operator== (const ILeaf &rhs) const
std::shared_ptr< ILeaf > | create_duplicate () const
| Interface implementation. More...
bool | is_compatible_with (const IDataProvider &data_provider)
| Interface implementation. More...
bool | is_compatible_with (const IThreshOpt &)
| Interface implementation. More...
void | transfer_or_run_check (ILeaf *other, IThreshOpt *thresh_opt, IDataProvider *dprov)
| Interface implementation. More...
void | make_leaf (const TodoMark &todo_info, const IDataProvider &data_provider, Desk *desk) const
| Interface implementation. More...
size_t | get_result_columns (const size_t &n_trees, const bool &predict_proba, const bool &) const
| Interface implementation. More...
Data< Mat > | get_result_type (const bool &, const bool &) const
| Interface implementation. More...
void | get_result (const id_t &node_id, Data< MatRef > &target, const bool &predict_proba, const bool &for_forest) const
| Interface implementation. More...
const std::vector< Mat< float > > * | get_map () const
| Interface implementation. More...
void | get_result (const std::vector< Data< Mat >> &leaf_results, Data< MatRef > &target_v, const Vec< float > &weights=Vec< float >(), const bool &predict_proba=false) const
| Interface implementation. More...
void | ensure_capacity (const size_t &n)
| Interface implementation. More...
void | finalize_capacity (const size_t &n)
| Interface implementation. More...
Public Member Functions inherited from forpy::ILeaf
virtual | ~ILeaf ()
virtual Data< Mat > | get_result (const id_t &node_id, const bool &predict_proba=false, const bool &for_forest=false) const
| Get the leaf data for the leaf with the given id. More...
virtual Data< Mat > | get_result (const std::vector< Data< Mat >> &leaf_results, const Vec< float > &weights=Vec< float >(), const bool &predict_proba=false) const
| Combine leaf results of several trees with weights. More...

## Private Member Functions
template<class Archive >
void | serialize (Archive &ar, const uint &)

## Private Attributes
std::vector< Mat< float > > | leaf_regression_map
size_t | annot_dim
bool | store_variance
bool | summarize

## Friends
class | cereal::access
std::ostream & | operator<< (std::ostream &stream, const RegressionLeaf &self)

## Additional Inherited Members
Protected Member Functions inherited from forpy::ILeaf
| ILeaf ()

## Detailed Description

Manages the leaf nodes of regression trees.

Definition at line 26 of file regressionleaf.h.

## Constructor & Destructor Documentation

## ◆ RegressionLeaf()

forpy::RegressionLeaf::RegressionLeaf | ( | const bool & | store_variance = `false`,
|  | const bool & | summarize = `false`
| ) |  |
| inline explicit

Definition at line 28 of file regressionleaf.h.

## Member Function Documentation

## ◆ create_duplicate()

std::shared_ptr<ILeaf> forpy::RegressionLeaf::create_duplicate | ( |  | ) | const
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 37 of file regressionleaf.h.

## ◆ ensure_capacity()

void forpy::RegressionLeaf::ensure_capacity | ( | const size_t & | n | ) |
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 101 of file regressionleaf.h.

## ◆ finalize_capacity()

void forpy::RegressionLeaf::finalize_capacity | ( | const size_t & | n | ) |
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 104 of file regressionleaf.h.

## ◆ get_map()

const std::vector<Mat<float> >* forpy::RegressionLeaf::get_map | ( |  | ) | const
| inline virtual

Interface implementation.

Implements forpy::ILeaf.

Definition at line 94 of file regressionleaf.h.

## ◆ get_result() [1/2]

void forpy::RegressionLeaf::get_result | ( | const id_t & | node_id,
|  | Data< MatRef > & | target,
|  | const bool & | predict_proba,
|  | const bool & | for_forest
| ) |  | const
| virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

## ◆ get_result() [2/2]

void forpy::RegressionLeaf::get_result | ( | const std::vector< Data< Mat >> & | leaf_results,
|  | Data< MatRef > & | target_v,
|  | const Vec< float > & | weights = `Vec< float >()`,
|  | const bool & | predict_proba = `false`
| ) |  | const
| virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

## ◆ get_result_columns()

size_t forpy::RegressionLeaf::get_result_columns | ( | const size_t & | n_trees,
|  | const bool & | predict_proba,
|  | const bool & |
| ) |  | const
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 60 of file regressionleaf.h.

## ◆ get_result_type()

Data<Mat> forpy::RegressionLeaf::get_result_type | ( | const bool & | ,
|  | const bool & |
| ) |  | const
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 86 of file regressionleaf.h.

## ◆ is_compatible_with() [1/2]

bool forpy::RegressionLeaf::is_compatible_with | ( | const IDataProvider & | data_provider | ) |
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 41 of file regressionleaf.h.

## ◆ is_compatible_with() [2/2]

bool forpy::RegressionLeaf::is_compatible_with | ( | const IThreshOpt & |  | ) |
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 45 of file regressionleaf.h.

## ◆ make_leaf()

void forpy::RegressionLeaf::make_leaf | ( | const TodoMark & | todo_info,
|  | const IDataProvider & | data_provider,
|  | Desk * | desk
| ) |  | const
| virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

## ◆ operator==()

bool forpy::RegressionLeaf::operator== | ( | const ILeaf & | rhs | ) | const
| virtual

Reimplemented from forpy::ILeaf.

## ◆ serialize()

template<class Archive >

void forpy::RegressionLeaf::serialize | ( | Archive & | ar,
|  | const uint & |
| ) |  |
| inline private

Definition at line 118 of file regressionleaf.h.

## ◆ transfer_or_run_check()

void forpy::RegressionLeaf::transfer_or_run_check | ( | ILeaf * | other,
|  | IThreshOpt * | thresh_opt,
|  | IDataProvider * | dprov
| ) |  |
| inline virtual

Interface implementation.

Reimplemented from forpy::ILeaf.

Definition at line 48 of file regressionleaf.h.

## Friends And Related Function Documentation

## ◆ cereal::access

friend class cereal::access
| friend

Definition at line 113 of file regressionleaf.h.

## ◆ operator<<

std::ostream& operator<< | ( | std::ostream & | stream,
|  | const RegressionLeaf & | self
| ) |  |
| friend

Definition at line 108 of file regressionleaf.h.

## Member Data Documentation

## ◆ annot_dim

size_t forpy::RegressionLeaf::annot_dim
| private

Definition at line 124 of file regressionleaf.h.

## ◆ leaf_regression_map

std::vector<Mat<float> > forpy::RegressionLeaf::leaf_regression_map
| private

Definition at line 123 of file regressionleaf.h.

## ◆ store_variance

bool forpy::RegressionLeaf::store_variance
| private

Definition at line 125 of file regressionleaf.h.

## ◆ summarize

bool forpy::RegressionLeaf::summarize
| private

Definition at line 126 of file regressionleaf.h.

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

- /Users/classner/git/forpy/include/forpy/leafs/regressionleaf.h