37 using namespace shogun;
45 void CDependenceMaximization::init()
62 bool CDependenceMaximization::init(
CFeatures* features)
64 REQUIRE(features,
"Features are not initialized!\n");
67 "Only allowed for dense/sparse features! Provided an instance of "
68 "%s which is of class %d!\n",
71 "features of double type! Provided %d!\n",
85 REQUIRE(num_features>idx,
"Specified dimension to remove (%d) is greater "
86 "than the total number of current features (%d)!\n",
91 for (
index_t i=0; i<num_features; ++i)
121 SG_DEBUG(
"statistic = %f!\n", statistic);
135 "not set! Please use set_num_remove() to set this!\n");
137 "Only N_SMALLEST and PERCENTILE_SMALLEST removal policy can work "
139 REQUIRE(features,
"Features is not intialized!\n");
140 REQUIRE(argsorted.
vector,
"The argsorted vector is not initialized!\n");
142 "argsorted vector should be equal to the number of features (%d)! "
143 "But it was %d!\n", argsorted.
vlen);
148 threshold*=argsorted.
vlen*0.01;
151 REQUIRE(threshold<argsorted.
vlen,
"The threshold of removal is too high "
152 "(asked to remove %d features out of %d)! Please use a smaller "
153 "number for removal using set_num_remove() call",
154 threshold, argsorted.
vlen);
170 return reduced_feats;
176 "Only N_SMALLEST and PERCENTILE_SMALLEST removal policy can work "
190 for (
index_t i=0; i<labels_matrix.num_cols; ++i)
CFeatures * m_labels_feats
virtual const char * get_name() const =0
virtual float64_t get_value(int32_t idx)
The class Labels models labels, i.e. class assignments of objects.
virtual int32_t get_num_labels() const =0
virtual ~CDependenceMaximization()
virtual const char * get_name() const
virtual void set_p(CFeatures *p)
virtual float64_t compute_measures(CFeatures *features, index_t idx)
Template class CFeatureSelection, base class for all feature selection preprocessors which select a s...
CDependenceMaximization()
virtual void set_labels(CLabels *labels)
Class SGObject is the base class of all shogun objects.
virtual EFeatureClass get_feature_class() const =0
virtual bool init(CFeatures *features)
EMessageType get_loglevel() const
virtual CFeatures * remove_feats(CFeatures *features, SGVector< index_t > ranks)
virtual CFeatures * copy_dimension_subset(SGVector< index_t > dims)
index_t get_num_features(CFeatures *features) const
EFeatureRemovalPolicy m_policy
The class Features is the base class of all feature objects.
virtual void set_labels(CLabels *labels)
virtual CFeatures * create_transformed_copy(CFeatures *features, index_t idx)
virtual void set_policy(EFeatureRemovalPolicy policy)
void display_vector(const char *name="vector", const char *prefix="") const
virtual float64_t compute_statistic()=0
virtual EFeatureType get_feature_type() const =0
virtual void set_q(CFeatures *q)
CIndependenceTest * m_estimator