Public Member Functions | Protected Member Functions | Protected Attributes

CAttributeFeatures Class Reference


Detailed Description

Implements attributed features, that is in the simplest case a number of (attribute, value) pairs.

For example

x[0...].attr1 = <value(s)> x[0...].attr2 = <value(s)>.

A more complex example would be nested structures x[0...].attr1[0...].subattr1 = ..

This might be used to represent (attr, value) pairs, simple structures, trees ...

Definition at line 46 of file AttributeFeatures.h.

Inheritance diagram for CAttributeFeatures:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CAttributeFeatures ()
virtual ~CAttributeFeatures ()
CFeaturesget_attribute (char *attr_name)
void get_attribute_by_index (int idx, const char *&attr_name, CFeatures *&attr_obj)
bool set_attribute (char *attr_name, CFeatures *attr_obj)
bool del_attribute (char *attr_name)
int32_t get_num_attributes ()
virtual const char * get_name () const
virtual CFeaturesduplicate () const =0
virtual EFeatureType get_feature_type ()=0
virtual EFeatureClass get_feature_class ()=0
virtual int32_t get_num_vectors () const =0
virtual int32_t get_size ()=0

Protected Member Functions

int32_t find_attr_index (char *attr_name)

Protected Attributes

DynArray< T_ATTRIBUTE > features
 list of attributes (sorted)

Constructor & Destructor Documentation

default constructor

Definition at line 16 of file AttributeFeatures.cpp.

~CAttributeFeatures (  )  [virtual]

destructor

Definition at line 21 of file AttributeFeatures.cpp.


Member Function Documentation

bool del_attribute ( char *  attr_name  ) 

delete the attribute matching attribute name

Parameters:
attr_name attribute name
Returns:
true on success

Definition at line 114 of file AttributeFeatures.h.

virtual CFeatures* duplicate (  )  const [pure virtual]

duplicate feature object

abstract base method

Returns:
feature object

Implements CFeatures.

int32_t find_attr_index ( char *  attr_name  )  [protected]

find the index of the attribute matching attribute name

Parameters:
attr_name attribute name
Returns:
index (if found), otherwise -1

Definition at line 187 of file AttributeFeatures.h.

CFeatures* get_attribute ( char *  attr_name  ) 

return the feature object matching attribute name

Parameters:
attr_name attribute name
Returns:
feature object

Definition at line 61 of file AttributeFeatures.h.

void get_attribute_by_index ( int  idx,
const char *&  attr_name,
CFeatures *&  attr_obj 
)

return the feature object at index

Parameters:
idx index of attribute
attr_name attribute name (returned by reference)
attr_obj attribute object (returned by reference)

Definition at line 80 of file AttributeFeatures.h.

virtual EFeatureClass get_feature_class (  )  [pure virtual]

get feature class

abstract base method

Returns:
feature class like STRING, SIMPLE, SPARSE...

Implements CFeatures.

virtual EFeatureType get_feature_type (  )  [pure virtual]

get feature type

abstract base method

Returns:
templated feature type

Implements CFeatures.

virtual const char* get_name ( void   )  const [virtual]
Returns:
object name

Implements CSGObject.

Definition at line 139 of file AttributeFeatures.h.

int32_t get_num_attributes (  ) 

get number of attributes

Returns:
number of attributes

Definition at line 133 of file AttributeFeatures.h.

virtual int32_t get_num_vectors (  )  const [pure virtual]

get number of examples/vectors

abstract base method

Returns:
number of examples/vectors

Implements CFeatures.

virtual int32_t get_size (  )  [pure virtual]

get memory footprint of one feature

abstract base method

Returns:
memory footprint of one feature

Implements CFeatures.

bool set_attribute ( char *  attr_name,
CFeatures attr_obj 
)

set the feature object for attribute name

Parameters:
attr_name attribute name
attr_obj feature object to set
Returns:
true on success

Definition at line 94 of file AttributeFeatures.h.


Member Data Documentation

DynArray<T_ATTRIBUTE> features [protected]

list of attributes (sorted)

Definition at line 202 of file AttributeFeatures.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation