Classes | Typedefs | Functions
ML::DT Namespace Reference

Classes

struct  DecisionTreeParams
 
struct  TreeMetaDataNode
 
struct  Dataset
 
struct  Quantiles
 
class  TreeliteType
 
class  TreeliteType< float >
 
class  TreeliteType< double >
 
class  TreeliteType< uint32_t >
 
class  TreeliteType< int >
 

Typedefs

typedef TreeMetaDataNode< float, int > TreeClassifierF
 
typedef TreeMetaDataNode< double, int > TreeClassifierD
 
typedef TreeMetaDataNode< float, float > TreeRegressorF
 
typedef TreeMetaDataNode< double, double > TreeRegressorD
 

Functions

void set_tree_params (DecisionTreeParams &params, int cfg_max_depth=-1, int cfg_max_leaves=-1, float cfg_max_features=1.0f, int cfg_max_n_bins=128, int cfg_min_samples_leaf=1, int cfg_min_samples_split=2, float cfg_min_impurity_decrease=0.0f, CRITERION cfg_split_criterion=CRITERION_END, int cfg_max_batch_size=4096)
 Set all DecisionTreeParams members. More...
 
template<class T , class L >
std::string get_tree_summary_text (const TreeMetaDataNode< T, L > *tree)
 Obtain high-level tree information. More...
 
template<class T , class L >
std::string get_tree_text (const TreeMetaDataNode< T, L > *tree)
 Obtain detailed tree information. More...
 
template<class T , class L >
std::string get_tree_json (const TreeMetaDataNode< T, L > *tree)
 Export tree as a JSON string. More...
 

Typedef Documentation

◆ TreeClassifierD

◆ TreeClassifierF

◆ TreeRegressorD

typedef TreeMetaDataNode<double, double> ML::DT::TreeRegressorD

◆ TreeRegressorF

Function Documentation

◆ get_tree_json()

template<class T , class L >
std::string ML::DT::get_tree_json ( const TreeMetaDataNode< T, L > *  tree)

Export tree as a JSON string.

Template Parameters
Tdata type for input data (float or double).
Ldata type for labels (int type for classification, T type for regression).
Parameters
[in]treeCPU pointer to TreeMetaDataNode
Returns
Tree structure as JSON stsring

◆ get_tree_summary_text()

template<class T , class L >
std::string ML::DT::get_tree_summary_text ( const TreeMetaDataNode< T, L > *  tree)

Obtain high-level tree information.

Template Parameters
Tdata type for input data (float or double).
Ldata type for labels (int type for classification, T type for regression).
Parameters
[in]treeCPU pointer to TreeMetaDataNode
Returns
High-level tree information as string

◆ get_tree_text()

template<class T , class L >
std::string ML::DT::get_tree_text ( const TreeMetaDataNode< T, L > *  tree)

Obtain detailed tree information.

Template Parameters
Tdata type for input data (float or double).
Ldata type for labels (int type for classification, T type for regression).
Parameters
[in]treeCPU pointer to TreeMetaDataNode
Returns
Detailed tree information as string

◆ set_tree_params()

void ML::DT::set_tree_params ( DecisionTreeParams params,
int  cfg_max_depth = -1,
int  cfg_max_leaves = -1,
float  cfg_max_features = 1.0f,
int  cfg_max_n_bins = 128,
int  cfg_min_samples_leaf = 1,
int  cfg_min_samples_split = 2,
float  cfg_min_impurity_decrease = 0.0f,
CRITERION  cfg_split_criterion = CRITERION_END,
int  cfg_max_batch_size = 4096 
)

Set all DecisionTreeParams members.

Parameters
[in,out]paramsupdate with tree parameters
[in]cfg_max_depthmaximum tree depth; default -1
[in]cfg_max_leavesmaximum leaves; default -1
[in]cfg_max_featuresmaximum number of features; default 1.0f
[in]cfg_max_n_binsmaximum number of bins; default 128
[in]cfg_min_samples_leafmin. rows in each leaf node; default 1
[in]cfg_min_samples_splitmin. rows needed to split an internal node; default 2
[in]cfg_min_impurity_decreasesplit a node only if its reduction in impurity is more than this value
[in]cfg_split_criterionsplit criterion; default CRITERION_END, i.e., GINI for classification or MSE for regression
[in]cfg_max_batch_sizeMaximum number of nodes that can be processed in a batch. This is used only for batched-level algo. Default value 4096.