20 using namespace shogun;
34 preproc = orig.preproc;
35 num_preproc = orig.num_preproc;
37 preprocessed=
SG_MALLOC(
bool, orig.num_preproc);
38 memcpy(preprocessed, orig.preprocessed,
sizeof(
bool)*orig.num_preproc);
47 SG_INFO(
"Feature object loaded (%p)\n",
this) ;
60 "Feature properties.");
62 "Size of cache in MB.");
65 &num_preproc,
"preproc",
66 "List of preprocessors.");
68 &num_preproc,
"preprocessed",
69 "Feature[i] is already preprocessed.");
84 SG_INFO(
"%d preprocs currently, new preproc list is\n", num_preproc);
87 bool* preprocd=
SG_MALLOC(
bool, num_preproc+1);
89 for (int32_t i=0; i<num_preproc; i++)
92 preprocd[i]=preprocessed[i];
97 preprocessed=preprocd;
98 preproc[num_preproc]=p;
99 preprocessed[num_preproc]=
false;
103 for (int32_t i=0; i<num_preproc; i++)
104 SG_INFO(
"preproc[%d]=%s %ld\n",i, preproc[i]->
get_name(), preproc[i]) ;
128 for (int32_t i=0; i<num_preproc; i++)
150 if (num_preproc>0 && num<num_preproc)
152 removed_preproc=preproc[num];
157 preprocd=
SG_MALLOC(
bool, num_preproc-1);
162 for (int32_t i=0; i<num_preproc; i++)
167 preprocd[j]=preprocessed[i];
177 preprocessed=preprocd;
181 for (int32_t i=0; i<num_preproc; i++)
186 return removed_preproc;
191 preprocessed[num]=
true;
196 return preprocessed[num];
248 SG_INFO(
"C_STREAMING_SIMPLE ");
251 SG_INFO(
"C_STREAMING_SPARSE ");
254 SG_INFO(
"C_STREAMING_STRING ");
263 SG_ERROR(
"ERROR UNKNOWN FEATURE CLASS");
308 SG_ERROR(
"ERROR UNKNOWN FEATURE TYPE\n");
339 return (properties & p) != 0;
349 properties &= (properties | p) ^ p;
377 SG_ERROR(
"copy_subset and therefore model storage of CMachine "
378 "(required for cross-validation and model-selection is ",
379 "not yet implemented for feature type %s\n",
get_name());
virtual const char * get_name() const =0
bool has_property(EFeatureProperty p)
class for adding subset support to a class. Provides an interface for getting/setting subset_matrices...
virtual void save(CFile *writer)
bool is_preprocessed(int32_t num)
virtual bool reshape(int32_t num_features, int32_t num_vectors)
bool check_feature_compatibility(CFeatures *f)
virtual EFeatureType get_feature_type()=0
void set_preprocessed(int32_t num)
virtual CPreprocessor * del_preprocessor(int32_t num)
del current preprocessor
CFeatures(int32_t size=0)
void set_property(EFeatureProperty p)
#define SG_NOTIMPLEMENTED
int32_t get_num_preprocessors() const
virtual void subset_changed_post()
void add(bool *param, const char *name, const char *description="")
Class SGObject is the base class of all shogun objects.
virtual EFeatureClass get_feature_class()=0
void unset_property(EFeatureProperty p)
A File access base class.
virtual void load(CFile *loader)
virtual int32_t add_preprocessor(CPreprocessor *p)
set preprocessor
void add_vector(bool **param, index_t *length, const char *name, const char *description="")
virtual void remove_subset()
virtual CFeatures * copy_subset(SGVector< index_t > indices)
int32_t get_num_preprocessed()
get whether specified preprocessor (or all if num=1) was/were already applied
CPreprocessor * get_preprocessor(int32_t num)
get current preprocessor
The class Features is the base class of all feature objects.
index_t subset_idx_conversion(index_t idx) const
Class Preprocessor defines a preprocessor interface.
index_t subset_idx_conversion(index_t idx) const
void clean_preprocessors()
clears all preprocs
virtual void set_subset(CSubset *subset)
EFeatureProperty
shogun feature properties
#define SG_MALLOC(type, len)