32 #include <shogun/mathematics/Math.h>
48 REQUIRE(size>0,
"Subset size should be greater than 0. %d supplied!\n",size)
53 SGVector<float64_t>& left, SGVector<float64_t>& right, SGVector<bool>& is_left_final, index_t &num_missing_final, index_t &count_left,
54 index_t &count_right, float64_t& IG, index_t subset_size,
const SGVector<index_t>& active_indices)
57 auto num_feats = (
m_pre_sort) ? mat.num_cols : mat.num_rows;
64 REQUIRE(subset_size<=num_feats,
"The Feature subset size(set %d) should be less than"
65 " or equal to the total number of features(%d here).\n",subset_size,num_feats)
67 return CMyCARTree::compute_best_attribute(mat,weights,labels,left,right,is_left_final,num_missing_final,count_left,count_right, IG, subset_size, active_indices);
77 if(!clone_obj->clone_parameters(
this))
91 SG_ADD(&
m_randsubset_size,
"m_randsubset_size",
"random features subset size", MS_NOT_AVAILABLE);
virtual int32_t compute_best_attribute(const SGMatrix< float64_t > &mat, const SGVector< float64_t > &weights, CLabels *labels, 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, float64_t &IG, int32_t subset_size=0, const SGVector< int32_t > &active_indices=SGVector< index_t >())
This class implements randomized CART algorithm used in the tree growing process of candidate trees i...
virtual index_t compute_best_attribute(const SGMatrix< float64_t > &mat, const SGVector< float64_t > &weights, CDenseLabels *labels, SGVector< float64_t > &left, SGVector< float64_t > &right, SGVector< bool > &is_left_final, index_t &num_missing, index_t &count_left, index_t &count_right, float64_t &IG, index_t subset_size=0, const SGVector< index_t > &active_indices=SGVector< index_t >())
index_t m_randsubset_size
virtual ~CMyRandomCARTree()
void set_feature_subset_size(index_t size)
CMyRandomCARTree * clone()