110 virtual const char*
get_name()
const {
return "CARTree"; }
269 int32_t &count_left, int32_t &count_right);
CLabels * apply_from_current_node(CDenseFeatures< float64_t > *feats, bnode_t *current)
The node of the tree structure forming a TreeMachine The node contains pointer to its parent and poin...
int32_t get_max_depth() const
void set_weights(SGVector< float64_t > w)
Real Labels are real-valued labels.
SGVector< bool > get_feature_types() const
int32_t get_min_node_size() const
float64_t get_label_epsilon()
void set_machine_problem_type(EProblemType mode)
int32_t get_num_folds() const
CDynamicObjectArray * prune_tree(CTreeMachine< CARTreeNodeData > *tree)
The class Labels models labels, i.e. class assignments of objects.
virtual CMulticlassLabels * apply_multiclass(CFeatures *data=NULL)
float64_t find_weakest_alpha(bnode_t *node)
float64_t least_squares_deviation(SGVector< float64_t > labels, SGVector< float64_t > weights, float64_t &total_weight)
void form_t1(bnode_t *node)
virtual bool is_label_valid(CLabels *lab) const
virtual const char * get_name() const
static const float64_t EQ_DELTA
SGVector< bool > surrogate_split(SGMatrix< float64_t > data, SGVector< float64_t > weights, SGVector< bool > nm_left, int32_t attr)
virtual bool train_machine(CFeatures *data=NULL)
float64_t m_label_epsilon
virtual void set_labels(CLabels *lab)
Multiclass Labels for multi-class classification.
static const float64_t epsilon
float64_t gini_impurity_index(SGVector< float64_t > weighted_lab_classes, float64_t &total_weight)
void clear_feature_types()
float64_t gain(SGVector< float64_t > wleft, SGVector< float64_t > wright, SGVector< float64_t > wtotal, SGVector< float64_t > labels)
void set_min_node_size(int32_t nsize)
void handle_missing_vecs_for_continuous_surrogate(SGMatrix< float64_t > m, CDynamicArray< int32_t > *missing_vecs, CDynamicArray< float64_t > *association_index, CDynamicArray< int32_t > *intersect_vecs, SGVector< bool > is_left, SGVector< float64_t > weights, float64_t p, int32_t attr)
void set_num_folds(int32_t folds)
SGVector< float64_t > get_weights() const
Dynamic array class for CSGObject pointers that creates an array that can be used like a list or an a...
virtual CBinaryTreeMachineNode< CARTreeNodeData > * CARTtrain(CFeatures *data, SGVector< float64_t > weights, CLabels *labels, int32_t level)
void set_max_depth(int32_t depth)
void handle_missing_vecs_for_nominal_surrogate(SGMatrix< float64_t > m, CDynamicArray< int32_t > *missing_vecs, CDynamicArray< float64_t > *association_index, CDynamicArray< int32_t > *intersect_vecs, SGVector< bool > is_left, SGVector< float64_t > weights, float64_t p, int32_t attr)
This class implements the Classification And Regression Trees algorithm by Breiman et al for decision...
all of classes and functions are contained in the shogun namespace
void set_feature_types(SGVector< bool > ft)
virtual int32_t compute_best_attribute(SGMatrix< float64_t > mat, SGVector< float64_t > weights, SGVector< float64_t > labels_vec, SGVector< float64_t > left, SGVector< float64_t > right, SGVector< bool > is_left_final, int32_t &num_missing, int32_t &count_left, int32_t &count_right)
The class Features is the base class of all feature objects.
virtual EProblemType get_machine_problem_type() const
SGVector< bool > m_nominal
float64_t compute_error(CLabels *labels, CLabels *reference, SGVector< float64_t > weights)
void cut_weakest_link(bnode_t *node, float64_t alpha)
static const float64_t MIN_SPLIT_GAIN
virtual CRegressionLabels * apply_regression(CFeatures *data=NULL)
void prune_using_test_dataset(CDenseFeatures< float64_t > *feats, CLabels *gnd_truth, SGVector< float64_t > weights=SGVector< float64_t >())
class TreeMachine, a base class for tree based multiclass classifiers. This class is derived from CBa...
SGVector< float64_t > m_weights
CDynamicArray< float64_t > * m_alphas
SGVector< float64_t > get_unique_labels(SGVector< float64_t > labels_vec, int32_t &n_ulabels)
void set_label_epsilon(float64_t epsilon)
void prune_by_cross_validation(CDenseFeatures< float64_t > *data, int32_t folds)
static const float64_t MISSING