CFeatures Class Reference


Detailed Description

The class Features is the base class of all feature objects.

It can be understood as a dense real valued feature matrix (with e.g. columns as single feature vectors), a set of strings, graphs or any other arbitrary collection of objects. As a result this class is kept very general and implements only very weak interfaces to

In addition it provides helpers to check e.g. for compability of feature objects.

Currently there are 3 general feature classes, which are CSimpleFeatures (dense matrices), CSparseFeatures (sparse matrices), CStringFeatures (a set of strings) from which all the specific features like CSimpleFeatures<float64_t> (dense real valued feature matrices) are derived.

Definition at line 86 of file Features.h.

Inheritance diagram for CFeatures:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CFeatures (int32_t size=0)
 CFeatures (const CFeatures &orig)
 CFeatures (char *fname)
virtual CFeaturesduplicate () const =0
virtual ~CFeatures ()
virtual EFeatureType get_feature_type ()=0
virtual EFeatureClass get_feature_class ()=0
virtual int32_t add_preproc (CPreProc *p)
 set preprocessor
virtual CPreProcdel_preproc (int32_t num)
 del current preprocessor
CPreProcget_preproc (int32_t num)
 get current preprocessor
void set_preprocessed (int32_t num)
bool is_preprocessed (int32_t num)
int32_t get_num_preprocessed ()
 get whether specified preprocessor (or all if num=1) was/were already applied
int32_t get_num_preproc ()
void clean_preprocs ()
int32_t get_cache_size ()
virtual int32_t get_num_vectors ()=0
virtual bool reshape (int32_t num_features, int32_t num_vectors)
virtual int32_t get_size ()=0
void list_feature_obj ()
virtual bool load (char *fname)
virtual bool save (char *fname)
bool check_feature_compatibility (CFeatures *f)
bool has_property (EFeatureProperty p)
void set_property (EFeatureProperty p)
void unset_property (EFeatureProperty p)

Constructor & Destructor Documentation

CFeatures::CFeatures ( int32_t  size = 0  ) 

constructor

Parameters:
size cache size

Definition at line 18 of file Features.cpp.

CFeatures::CFeatures ( const CFeatures orig  ) 

copy constructor

Definition at line 25 of file Features.cpp.

CFeatures::CFeatures ( char *  fname  ) 

constructor

Parameters:
fname filename to load features from

Definition at line 33 of file Features.cpp.

CFeatures::~CFeatures (  )  [virtual]

Definition at line 41 of file Features.cpp.


Member Function Documentation

int32_t CFeatures::add_preproc ( CPreProc p  )  [virtual]

set preprocessor

add preprocessor

Parameters:
p preprocessor to set
Returns:
something inty

Definition at line 48 of file Features.cpp.

bool CFeatures::check_feature_compatibility ( CFeatures f  ) 

check feature compatibility

Parameters:
f features to check for compatibility
Returns:
if features are compatible

Definition at line 250 of file Features.cpp.

void CFeatures::clean_preprocs (  ) 

clears all preprocs

Definition at line 104 of file Features.cpp.

CPreProc * CFeatures::del_preproc ( int32_t  num  )  [virtual]

del current preprocessor

delete preprocessor from list caller has to clean up returned preproc

Parameters:
num index of preprocessor in list

Definition at line 110 of file Features.cpp.

virtual CFeatures* CFeatures::duplicate (  )  const [pure virtual]
int32_t CFeatures::get_cache_size (  ) 

get cache size

Returns:
cache size

Definition at line 181 of file Features.h.

virtual EFeatureClass CFeatures::get_feature_class (  )  [pure virtual]
virtual EFeatureType CFeatures::get_feature_type (  )  [pure virtual]
int32_t CFeatures::get_num_preproc (  ) 

get number of preprocessors

Returns:
number of preprocessors

Definition at line 172 of file Features.h.

int32_t CFeatures::get_num_preprocessed (  ) 

get whether specified preprocessor (or all if num=1) was/were already applied

get the number of applied preprocs

Returns:
number of applied preprocessors

Definition at line 90 of file Features.cpp.

virtual int32_t CFeatures::get_num_vectors (  )  [pure virtual]
CPreProc * CFeatures::get_preproc ( int32_t  num  ) 

get current preprocessor

get specified preprocessor

Parameters:
num index of preprocessor in list

Definition at line 78 of file Features.cpp.

virtual int32_t CFeatures::get_size (  )  [pure virtual]
bool CFeatures::has_property ( EFeatureProperty  p  ) 

check if features have given property

Parameters:
p feature property
Returns:
if features have given property

Definition at line 238 of file Features.h.

bool CFeatures::is_preprocessed ( int32_t  num  ) 

get whether specified preprocessor was already applied

Parameters:
num index of preprocessor in list

Definition at line 160 of file Features.h.

void CFeatures::list_feature_obj (  ) 

list feature object

Definition at line 155 of file Features.cpp.

bool CFeatures::load ( char *  fname  )  [virtual]

load features from file

Parameters:
fname filename to load from
Returns:
if loading was successful

Reimplemented in CSimpleFeatures< ST >, CStringFeatures< ST >, CSimpleFeatures< float64_t >, CStringFeatures< uint8_t >, and CStringFeatures< uint16_t >.

Definition at line 240 of file Features.cpp.

virtual bool CFeatures::reshape ( int32_t  num_features,
int32_t  num_vectors 
) [virtual]

in case there is a feature matrix allow for reshaping

NOT IMPLEMENTED!

Parameters:
num_features new number of features
num_vectors new number of vectors
Returns:
if reshaping was succesful

Reimplemented in CSimpleFeatures< ST >, and CSimpleFeatures< float64_t >.

Definition at line 199 of file Features.h.

bool CFeatures::save ( char *  fname  )  [virtual]

save features to file

Parameters:
fname filename to save to
Returns:
if saving was successful

Reimplemented in CSimpleFeatures< ST >, CStringFeatures< ST >, CSimpleFeatures< float64_t >, CStringFeatures< uint8_t >, and CStringFeatures< uint16_t >.

Definition at line 245 of file Features.cpp.

void CFeatures::set_preprocessed ( int32_t  num  ) 

set applied flag for preprocessor

Parameters:
num index of preprocessor in list

Definition at line 154 of file Features.h.

void CFeatures::set_property ( EFeatureProperty  p  ) 

set property

Parameters:
p kernel property to set

Definition at line 244 of file Features.h.

void CFeatures::unset_property ( EFeatureProperty  p  ) 

unset property

Parameters:
p kernel property to unset

Definition at line 253 of file Features.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation