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)
67 SG_INFO(
"PCA created (%p), do_whitening %i threshold %e", preproc, do_whitening, threshold)
69 SG_ERROR(
"Could not create preproc PCA, do_whitening %i threshold %e", do_whitening, threshold)
91 SG_ERROR(
"Unknown Preprocessor type %d\n", type)
95 SG_INFO(
"Preproc of type %d created (%p).\n", type, preproc)
97 SG_ERROR(
"Could not create preproc of type %d.\n", type)
121 return (preproc!=NULL);
128 if (strncmp(target,
"TRAIN", 5)==0)
130 CFeatures* f=
ui->ui_features->get_train_features();
132 SG_ERROR(
"No train features assigned!\n")
138 ui->ui_features->invalidate_train();
141 else if (strncmp(target,
"TEST", 4)==0)
143 CFeatures* f_test=
ui->ui_features->get_test_features();
145 SG_ERROR(
"No test features assigned!\n")
147 CFeatures* f_train=
ui->ui_features->get_train_features();
149 SG_ERROR(
"No train features assigned!\n")
154 if (fclass_train==fclass_test)
165 SG_ERROR(
"One of the combined features has no sub-features ?!\n")
168 SG_INFO(
"BEGIN PREPROCESSING COMBINED FEATURES (%d sub-featureobjects).\n", num_combined)
170 for (; f_idx<num_combined; f_idx++)
175 if (!(te_feat && tr_feat))
185 ASSERT(f_idx==num_combined)
187 SG_INFO(
"END PREPROCESSING COMBINED FEATURES\n")
190 SG_ERROR(
"combined features not compatible\n")
195 ui->ui_features->invalidate_test();
200 SG_ERROR(
"Features not compatible.\n")
203 SG_ERROR(
"Features not correctly assigned!\n")
224 SG_ERROR(
"more preprocessors attached to test features than to train features\n")
233 preproc->
init(trainfeat);
247 preproc->
init(trainfeat);
256 preproc->
init(trainfeat);
267 SG_ERROR(
"no features for preprocessing available!\n")
314 SG_ERROR(
"Combined feature objects cannot be preprocessed. Only its sub-feature objects!\n")
virtual bool init(CFeatures *features)=0
CSGObject * get_next_element()
#define SG_NOTIMPLEMENTED
CPreprocessor * get_preprocessor(int32_t num) const
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()
void list_feature_obj() const
Class SGObject is the base class of all shogun objects.
CPreprocessor * create_generic(EPreprocessorType type)
bool preproc_all_features(CFeatures *f, bool force)
virtual EFeatureClass get_feature_class() const =0
int32_t get_num_elements()
bool preprocess_features(CFeatures *trainfeat, CFeatures *testfeat, bool force)
virtual void add_preprocessor(CPreprocessor *p)
Preprocessor NormOne, normalizes vectors to have norm 1.
all of classes and functions are contained in the shogun namespace
bool add_preproc(CPreprocessor *preproc)
The class Features is the base class of all feature objects.
Preprocessor PCA performs principial component analysis on input feature vectors/matrices. When the init method in PCA is called with proper feature matrix X (with say N number of vectors and D feature dimension), a transformation matrix is computed and stored internally. This transformation matrix is then used to transform all D-dimensional feature vectors or feature matrices (with D feature dimensions) supplied via apply_to_feature_matrix or apply_to_feature_vector methods. This tranformation outputs the T-Dimensional approximation of all these input vectors and matrices (where T<=min(D,N)). The transformation matrix is essentially a DxT matrix, the columns of which correspond to the eigenvectors of the covariance matrix(XX') having top T eigenvalues.
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)
virtual EFeatureType get_feature_type() const =0
Class List implements a doubly connected list for low-level-objects.