forpy  2
forpy::ClassificationForest Class Reference

#include <forest.h>

Inheritance diagram for forpy::ClassificationForest:
forpy::Forest

Public Member Functions

 ClassificationForest (const std::string &filename)
 
 ClassificationForest (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=true, const uint &random_seed=1, const size_t &n_thresholds=0, const float &gain_threshold=1E-7f)
 
std::unordered_map< std::string, mu::variant< uint, size_t, float, bool > > get_params (const bool &=false) const
 
std::shared_ptr< ClassificationForestset_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)
 
Forestfit (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
 
Forestfit_dprov (const std::shared_ptr< IDataProvider > &fdata_provider, const bool &bootstrap=true)
 The fitting function for a forest. More...
 
Data< Matpredict (const Data< MatCRef > &data_v, const int &num_threads=1, const bool &use_fast_prediction_if_available=true, const bool &predict_proba=false)
 
Data< Matpredict_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 IDeciderget_decider () const
 
std::vector< std::shared_ptr< Tree > > get_trees () const
 
void enable_fast_prediction ()
 
void disable_fast_prediction ()
 
std::shared_ptr< const ILeafget_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 (ClassificationForest)
 

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 ClassificationForest &self)
 

Detailed Description

Definition at line 249 of file forest.h.

Constructor & Destructor Documentation

◆ ClassificationForest() [1/2]

forpy::ClassificationForest::ClassificationForest ( const std::string &  filename)
inline

Definition at line 251 of file forest.h.

◆ ClassificationForest() [2/2]

forpy::ClassificationForest::ClassificationForest ( 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 = true,
const uint random_seed = 1,
const size_t &  n_thresholds = 0,
const float &  gain_threshold = 1E-7f 
)

Member Function Documentation

◆ DISALLOW_COPY_AND_ASSIGN()

forpy::ClassificationForest::DISALLOW_COPY_AND_ASSIGN ( ClassificationForest  )
private

◆ get_params()

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

Definition at line 263 of file forest.h.

◆ serialize()

template<class Archive >
void forpy::ClassificationForest::serialize ( Archive &  ar,
const uint  
)
inlineprivate

Definition at line 296 of file forest.h.

◆ set_params()

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

Definition at line 267 of file forest.h.

Friends And Related Function Documentation

◆ cereal::access

friend class cereal::access
friend

Definition at line 294 of file forest.h.

◆ operator<<

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

Definition at line 283 of file forest.h.

Member Data Documentation

◆ params

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

Definition at line 289 of file forest.h.


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