forpy  2
forpy::RegressionLeaf Class Reference

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

#include <regressionleaf.h>

Inheritance diagram for forpy::RegressionLeaf:
forpy::ILeaf

Public Member Functions

 RegressionLeaf (const bool &store_variance=false, const bool &summarize=false)
 
bool operator== (const ILeaf &rhs) const
 
std::shared_ptr< ILeafcreate_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< Matget_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< Matget_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< Matget_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 
)
inlineexplicit

Definition at line 28 of file regressionleaf.h.

Member Function Documentation

◆ create_duplicate()

std::shared_ptr<ILeaf> forpy::RegressionLeaf::create_duplicate ( ) const
inlinevirtual

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)
inlinevirtual

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)
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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
inlinevirtual

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)
inlinevirtual

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 )
inlinevirtual

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  
)
inlineprivate

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 
)
inlinevirtual

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: