forpy
2
|
Stores and returns leaf values, and combines them to forest results. More...
#include <ileaf.h>
Public Member Functions | |
virtual | ~ILeaf () |
virtual std::shared_ptr< ILeaf > | create_duplicate () const VIRTUAL_PTR |
virtual bool | is_compatible_with (const IDataProvider &) |
Checks compatibility with a certain IDataProvider. More... | |
virtual bool | is_compatible_with (const IThreshOpt &threshopt) VIRTUAL(bool) |
virtual void | transfer_or_run_check (ILeaf *other, IThreshOpt *thresh_opt, IDataProvider *dprov) VIRTUAL_VOID |
virtual void | make_leaf (const TodoMark &todo_info, const IDataProvider &data_provider, Desk *desk) const VIRTUAL_VOID |
Creates a leaf with the specified node_id and data. More... | |
virtual size_t | get_result_columns (const size_t &n_trees=1, const bool &predict_proba=false, const bool &for_forest=false) const VIRTUAL(size_t) |
virtual Data< Mat > | get_result_type (const bool &predict_proba, const bool &for_forest=false) const VIRTUAL(Data< Mat >) |
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 void | get_result (const id_t &node_id, Data< MatRef > &target, const bool &predict_proba, const bool &for_forest) const VIRTUAL_VOID |
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... | |
virtual 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 VIRTUAL_VOID |
Get the fused forest result. More... | |
virtual void | ensure_capacity (const size_t &n) VIRTUAL_VOID |
Ensure that storage is available for at least n leafs. More... | |
virtual void | finalize_capacity (const size_t &n) VIRTUAL_VOID |
Cut down capacity to exactly n leafs. More... | |
virtual const std::vector< Mat< float > > * | get_map () const =0 |
Get all leafs. More... | |
virtual bool | operator== (const ILeaf &rhs) const VIRTUAL(bool) |
Protected Member Functions | |
ILeaf () | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &, const uint &) |
DISALLOW_COPY_AND_ASSIGN (ILeaf) | |
Friends | |
class | cereal::access |
Stores and returns leaf values, and combines them to forest results.
|
inlineprotected |
|
virtual |
Create a similar, but empty, leaf.
Reimplemented in forpy::ClassificationLeaf, and forpy::RegressionLeaf.
|
private |
|
virtual |
Ensure that storage is available for at least n leafs.
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
virtual |
Cut down capacity to exactly n leafs.
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
pure virtual |
Get all leafs.
Implemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
virtual |
Get the leaf data for the leaf with the given id.
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
virtual |
Get the fused forest result.
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
virtual |
Get the number of summary dimensions per sample.
Reimplemented in forpy::ClassificationLeaf, and forpy::RegressionLeaf.
|
virtual |
Get the result data type (a 0x0 mat within in appropriate variant).
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
inlinevirtual |
Checks compatibility with a certain IDataProvider.
This method is guaranteed to be called at the beginning of a training.
Reimplemented in forpy::ClassificationLeaf, and forpy::RegressionLeaf.
|
virtual |
Reimplemented in forpy::ClassificationLeaf, and forpy::RegressionLeaf.
|
virtual |
Creates a leaf with the specified node_id and data.
Reimplemented in forpy::ClassificationLeaf, and forpy::RegressionLeaf.
|
virtual |
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.
|
inlineprivate |
|
virtual |
Reimplemented in forpy::RegressionLeaf, and forpy::ClassificationLeaf.