forpy 2

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

`#include <forest.h>`

Inheritance diagram for forpy::RegressionForest:

## Public Member Functions
| RegressionForest (const std::string &filename)
| RegressionForest (const size_t &n_trees=10, const uint &max_depth=std::numeric_limits< uint >::max(), const uint &min_samples_at_leaf=1, const uint &min_samples_at_node=2, const uint &n_valid_features_to_use=0, const bool &autoscale_valid_features=false, const uint &random_seed=1, const size_t &n_thresholds=0, const float &gain_threshold=1E-7f, const bool &store_variance=false, const bool &summarize=false)
std::unordered_map< std::string, mu::variant< uint, size_t, float, bool > > | get_params (const bool &=false) const
std::shared_ptr< RegressionForest > | set_params (const std::unordered_map< std::string, mu::variant< uint, size_t, float, bool >> &params)
Public Member Functions inherited from forpy::Forest
| Forest (const uint &n_trees=10, const uint &max_depth=std::numeric_limits< uint >::max(), const uint &min_samples_at_leaf=1, const uint &min_samples_at_node=2, const std::shared_ptr< IDecider > &decider_template=nullptr, const std::shared_ptr< ILeaf > &leaf_manager_template=nullptr, const uint &random_seed=1)
| Forest (std::vector< std::shared_ptr< Tree >> &trees)
| Forest (std::string filename)
Forest * | fit (const Data< MatCRef > &data_v, const Data< MatCRef > &annotation_v, const size_t &num_threads=1, const bool &bootstrap=true, const std::vector< float > &weights=std::vector< float >())
std::vector< size_t > | get_depths () const
Forest * | fit_dprov (const std::shared_ptr< IDataProvider > &fdata_provider, const bool &bootstrap=true)
| The fitting function for a forest. More...
Data< Mat > | predict (const Data< MatCRef > &data_v, const int &num_threads=1, const bool &use_fast_prediction_if_available=true, const bool &predict_proba=false)
Data< Mat > | predict_proba (const Data< MatCRef > &data_v, const int &num_threads=1, const bool &use_fast_prediction_if_available=true)
size_t | get_input_data_dimensions () const
std::shared_ptr< const IDecider > | get_decider () const
std::vector< std::shared_ptr< Tree > > | get_trees () const
void | enable_fast_prediction ()
void | disable_fast_prediction ()
std::shared_ptr< const ILeaf > | get_leaf_manager () const
std::vector< float > | get_tree_weights () const
void | set_tree_weights (const std::vector< float > &weights) const
void | save (const std::string &filename) const
bool | operator== (const Forest &rhs) const

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

## Private Attributes
std::unordered_map< std::string, mu::variant< uint, size_t, float, bool > > | params

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

## Detailed Description

Definition at line 303 of file forest.h.

## Constructor & Destructor Documentation

## ◆ RegressionForest() [1/2]

forpy::RegressionForest::RegressionForest | ( | const std::string & | filename | ) |
| inline

Definition at line 305 of file forest.h.

## ◆ RegressionForest() [2/2]

forpy::RegressionForest::RegressionForest | ( | const size_t & | n_trees = `10`,
|  | const uint & | max_depth = `std::numeric_limits< uint >::max()`,
|  | const uint & | min_samples_at_leaf = `1`,
|  | const uint & | min_samples_at_node = `2`,
|  | const uint & | n_valid_features_to_use = `0`,
|  | const bool & | autoscale_valid_features = `false`,
|  | const uint & | random_seed = `1`,
|  | const size_t & | n_thresholds = `0`,
|  | const float & | gain_threshold = `1E-7f`,
|  | const bool & | store_variance = `false`,
|  | const bool & | summarize = `false`
| ) |  |

## Member Function Documentation

## ◆ DISALLOW_COPY_AND_ASSIGN()

forpy::RegressionForest::DISALLOW_COPY_AND_ASSIGN | ( | RegressionForest |  | ) |
| private

## ◆ get_params()

std::unordered_map<std::string, mu::variant<uint, size_t, float, bool> > forpy::RegressionForest::get_params | ( | const bool & | = `false` | ) | const
| inline

Definition at line 318 of file forest.h.

## ◆ serialize()

template<class Archive >

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

Definition at line 353 of file forest.h.

## ◆ set_params()

std::shared_ptr<RegressionForest> forpy::RegressionForest::set_params | ( | const std::unordered_map< std::string, mu::variant< uint, size_t, float, bool >> & | params | ) |
| inline

Definition at line 322 of file forest.h.

## Friends And Related Function Documentation

## ◆ cereal::access

friend class cereal::access
| friend

Definition at line 351 of file forest.h.

## ◆ operator<<

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

Definition at line 340 of file forest.h.

## Member Data Documentation

## ◆ params

std::unordered_map<std::string, mu::variant<uint, size_t, float, bool> > forpy::RegressionForest::params
| private

Definition at line 346 of file forest.h.

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

- /Users/classner/git/forpy/include/forpy/forest.h