45 initialize_parameters();
96 SG_DEBUG(
"Initial number of features %d!\n", num_features);
107 for (
index_t i=0; i<num_features; ++i)
135 if (to_remove>can_remove)
138 SG_DEBUG(
"Can only remove %d features in this iteration!\n",
154 if (to_remove>can_remove)
162 SG_DEBUG(
"Current number of features %d!\n", num_features);
181 REQUIRE(features,
"Features cannot be NULL!\n");
183 "Number of feature vectors has to be positive!\n");
185 "a higher number via set_target_dim().\n",
m_target_dim);
188 REQUIRE(num_features>0,
"Invalid number of features (%d)! Most likely " 189 "feature selection cannot be performed for %s!\n",
190 num_features, features->
get_name());
192 "Number of original features (dimensions of the feature vectors) " 193 "(%d) has to be greater that the target dimension (%d)!\n",
206 SG_ERROR(
"Specified algorithm not yet supported!\n");
243 REQUIRE(features,
"Features not initialized!\n");
252 REQUIRE(d_feats,
"Type mismatch for dense features!\n");
258 REQUIRE(s_feats,
"Type mismatch for sparse features!\n");
262 SG_ERROR(
"Number of features not available for %s!\n",
virtual void adapt_params(CFeatures *features)
SGVector< index_t > get_selected_feats()
The class Labels models labels, i.e. class assignments of objects.
virtual CSGObject * clone()
Template class SparseFeatures implements sparse matrices.
int32_t get_num_features() const
virtual EPreprocessorType get_type() const
EFeatureClass
shogun feature class
class to add subset support to another class. A CSubsetStackStack instance should be added and wrappe...
Template class CFeatureSelection, base class for all feature selection preprocessors which select a s...
static void qsort(T *output, int32_t size)
void set_num_remove(index_t num_remove)
EFeatureSelectionAlgorithm get_algorithm() const
virtual void set_labels(CLabels *labels)
virtual const char * get_name() const =0
virtual CFeatures * apply_backward_elimination(CFeatures *features)
Class SGObject is the base class of all shogun objects.
virtual void precompute()
virtual void remove_all_subsets()
EFeatureRemovalPolicy get_policy() const
static SGVector< index_t > argsort(SGVector< T > vector)
virtual EFeatureClass get_feature_class()
index_t subset_idx_conversion(index_t idx) const
EMessageType get_loglevel() const
int32_t get_num_features() const
EFeatureSelectionAlgorithm m_algorithm
virtual EFeatureClass get_feature_class() const =0
virtual float64_t compute_measures(CFeatures *features, index_t idx)=0
EFeatureType
shogun feature type
The class DenseFeatures implements dense feature matrices.
virtual CFeatures * remove_feats(CFeatures *features, SGVector< index_t > argsorted)=0
virtual EFeatureType get_feature_type()
all of classes and functions are contained in the shogun namespace
index_t get_num_features(CFeatures *features) const
EFeatureRemovalPolicy m_policy
The class Features is the base class of all feature objects.
EFeatureSelectionAlgorithm
Class Preprocessor defines a preprocessor interface.
virtual bool has_subsets() const
void set_target_dim(index_t target_dim)
virtual ~CFeatureSelection()
void display_vector(const char *name="vector", const char *prefix="") const
virtual CFeatures * apply(CFeatures *features)
virtual int32_t get_num_vectors() const =0
index_t get_num_remove() const
CLabels * get_labels() const
index_t get_target_dim() const