91 SG_ERROR(
"Machine is set as CRandomCART and cannot be changed\n")
106 REQUIRE(
m_machine,
"m_machine is NULL. It is expected to be RandomCARTree\n")
112 REQUIRE(
m_machine,
"m_machine is NULL. It is expected to be RandomCARTree\n")
118 REQUIRE(
m_machine,
"m_machine is NULL. It is expected to be RandomCARTree\n")
124 REQUIRE(
m_machine,
"m_machine is NULL. It is expected to be RandomCARTree\n")
130 REQUIRE(
m_machine,
"m_machine is NULL. It is expected to be RandomCARTree\n")
131 REQUIRE(rand_featsize>0,
"feature subset size should be greater than 0\n")
138 REQUIRE(
m_machine,
"m_machine is NULL. It is expected to be RandomCARTree\n")
144 REQUIRE(m,
"Machine supplied is NULL\n")
151 if (m_weights.
vlen==0)
157 for (int32_t i=0;i<idx.
vlen;i++)
158 weights[i]=m_weights[idx[i]];
183 void CRandomForest::init()
virtual bool train_machine(CFeatures *data=NULL)
void set_weights(SGVector< float64_t > w)
void set_machine_problem_type(EProblemType mode)
The class Labels models labels, i.e. class assignments of objects.
virtual bool train_machine(CFeatures *data=NULL)
void set_num_random_features(int32_t rand_featsize)
void set_machine_problem_type(EProblemType mode)
int32_t get_num_random_features() const
virtual EProblemType get_machine_problem_type() const
void set_feature_types(SGVector< bool > ft)
SGVector< bool > get_feature_types() const
A generic learning machine interface.
void set_weights(SGVector< float64_t > weights)
void set_sorted_features(SGMatrix< float64_t > &sorted_feats, SGMatrix< index_t > &sorted_indices)
virtual void set_machine_parameters(CMachine *m, SGVector< index_t > idx)
static void fill_vector(T *vec, int32_t len, T value)
void set_num_bags(int32_t num_bags)
This class implements randomized CART algorithm used in the tree growing process of candidate trees i...
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual void set_machine(CMachine *machine)
: Bagging algorithm i.e. bootstrap aggregating
virtual void set_labels(CLabels *lab)
SGVector< float64_t > get_weights() const