37 using namespace shogun;
55 SG_INFO(
"PRUNEVARSUBMEAN created (%p), divide_by_std %d", preproc, divide_by_std);
57 SG_ERROR(
"Could not create preproc PRUNEVARSUBMEAN, divide_by_std %d", divide_by_std);
68 SG_INFO(
"PCA created (%p), do_whitening %i threshold %e", preproc, do_whitening, threshold);
70 SG_ERROR(
"Could not create preproc PCA, do_whitening %i threshold %e", do_whitening, threshold);
74 SG_ERROR(
"Could not create preproc PCA - lapack not available at compile time\n");
96 SG_ERROR(
"Unknown Preprocessor type %d\n", type);
100 SG_INFO(
"Preproc of type %d created (%p).\n", type, preproc);
102 SG_ERROR(
"Could not create preproc of type %d.\n", type);
126 return (preproc!=NULL);
133 if (strncmp(target,
"TRAIN", 5)==0)
135 CFeatures* f=
ui->ui_features->get_train_features();
137 SG_ERROR(
"No train features assigned!\n");
143 ui->ui_features->invalidate_train();
146 else if (strncmp(target,
"TEST", 4)==0)
148 CFeatures* f_test=
ui->ui_features->get_test_features();
150 SG_ERROR(
"No test features assigned!\n");
152 CFeatures* f_train=
ui->ui_features->get_train_features();
154 SG_ERROR(
"No train features assigned!\n");
159 if (fclass_train==fclass_test)
172 if (!(num_combined && tr_feat && te_feat))
173 SG_ERROR(
"One of the combined features has no sub-features ?!\n");
175 SG_INFO(
"BEGIN PREPROCESSING COMBINED FEATURES (%d sub-featureobjects).\n", num_combined);
178 while (n<num_combined && tr_feat && te_feat)
192 SG_INFO(
"END PREPROCESSING COMBINED FEATURES\n");
195 SG_ERROR(
"combined features not compatible\n");
200 ui->ui_features->invalidate_test();
205 SG_ERROR(
"Features not compatible.\n");
208 SG_ERROR(
"Features not correctly assigned!\n");
229 SG_ERROR(
"more preprocessors attached to test features than to train features\n");
238 preproc->
init(trainfeat);
252 preproc->
init(trainfeat);
261 preproc->
init(trainfeat);
272 SG_ERROR(
"no features for preprocessing available!\n");
319 SG_ERROR(
"Combined feature objects cannot be preprocessed. Only its sub-feature objects!\n");
virtual bool init(CFeatures *features)=0
CSGObject * get_next_element()
virtual EFeatureType get_feature_type()=0
#define SG_NOTIMPLEMENTED
Preprocessor SortUlongString, sorts the indivual strings in ascending order.
Preprocessor LogPlusOne does what the name says, it adds one to a dense real valued vector and takes ...
CSGObject * delete_element()
EFeatureClass
shogun feature class
Preprocessor PruneVarSubMean will substract the mean and remove features that have zero variance...
CPreprocessor * create_prunevarsubmean(bool divide_by_std=false)
int32_t get_num_preprocessors() const
CSGObject * get_first_element()
Class SGObject is the base class of all shogun objects.
virtual EFeatureClass get_feature_class()=0
CPreprocessor * create_generic(EPreprocessorType type)
bool preproc_all_features(CFeatures *f, bool force)
int32_t get_num_elements()
bool preprocess_features(CFeatures *trainfeat, CFeatures *testfeat, bool force)
virtual int32_t add_preprocessor(CPreprocessor *p)
set preprocessor
Preprocessor NormOne, normalizes vectors to have norm 1.
CPreprocessor * get_preprocessor(int32_t num)
get current preprocessor
bool add_preproc(CPreprocessor *preproc)
The class Features is the base class of all feature objects.
Preprocessor PCACut performs principial component analysis on the input vectors and keeps only the n ...
bool attach_preproc(char *target, bool do_force=false)
Class Preprocessor defines a preprocessor interface.
Preprocessor that decompresses compressed strings.
Preprocessor SortWordString, sorts the indivual strings in ascending order.
The class CombinedFeatures is used to combine a number of of feature objects into a single CombinedFe...
bool append_element_at_listend(CSGObject *data)
CPreprocessor * create_pca(bool do_whitening, float64_t threshold)
Class List implements a doubly connected list for low-level-objects.