24 register_parameters();
43 int32_t num_features = simple_features->get_num_features();
53 memset(var, 0, num_features*
sizeof(
float64_t));
59 for (i=0; i<num_examples; i++)
61 for (j=0; j<num_features; j++)
65 for (j=0; j<num_features; j++)
69 for (i=0; i<num_examples; i++)
71 for (j=0; j<num_features; j++)
76 int32_t* idx_ok=SG_MALLOC(int32_t, num_features);
78 for (j=0; j<num_features; j++)
89 SG_INFO(
"Reducing number of features from %i to %i\n", num_features, num_ok)
95 for (j=0; j<num_ok; j++)
98 new_mean[j]=
m_mean[idx_ok[j]];
129 int32_t num_vectors=0;
130 int32_t num_features=0;
133 SG_INFO(
"get Feature matrix: %ix%i\n", num_vectors, num_features)
134 SG_INFO(
"Preprocessing feature matrix\n")
135 for (int32_t vec=0; vec<num_vectors; vec++)
142 for (int32_t feat=0; feat<
m_num_idx; feat++)
147 for (int32_t feat=0; feat<
m_num_idx; feat++)
154 SG_INFO(
"new Feature matrix: %ix%i\n", num_vectors, num_features)
183 for (int32_t i=0; i<vector.
vlen; i++)
190 void CPruneVarSubMean::init()
200 void CPruneVarSubMean::register_parameters()
SGVector< float64_t > m_mean
virtual void cleanup()
cleanup
virtual int32_t get_num_vectors() const =0
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
Template class DensePreprocessor, base class for preprocessors (cf. CPreprocessor) that apply to CDen...
SGVector< int32_t > m_idx
virtual EFeatureClass get_feature_class() const =0
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
bool m_initialized
true when already initialized
SGVector< float64_t > m_std
void resize_vector(int32_t n)
static float32_t sqrt(float32_t x)
virtual bool init(CFeatures *features)
initialize preprocessor from features
virtual ~CPruneVarSubMean()
CPruneVarSubMean(bool divide=true)
virtual EFeatureType get_feature_type() const =0