Inheritance diagram for classias::multi_data_base< instance_tmpl, feature_generator_tmpl >:
This class represents a data set for training a multi-class classifier. The class stores instances into a vector. This class implements the necessary functions num_attributes(), num_features(), and num_labels() for training algorithms. Do not forget to call set_num_features() and set_num_labels() to specify the total number of features and total number of labels, respectively.
instance_tmpl | The type of an instance. | |
feature_generator_tmpl | The type of a feature generator. |
Public Types | |
typedef instance_tmpl | instance_type |
The type of an instance. | |
typedef feature_generator_tmpl | feature_generator_type |
The type of the feature-generator class. | |
typedef candidate_data_base< instance_tmpl, feature_generator_tmpl > | base_type |
The base class. | |
typedef base_type::instances_type | instances_type |
A type providing a container of instances. | |
typedef base_type::size_type | size_type |
A type counting the number of pairs in a container. | |
typedef base_type::iterator | iterator |
A type providing a random-access iterator. | |
typedef base_type::const_iterator | const_iterator |
A type providing a read-only random-access iterator. | |
typedef base_type::attribute_type | attribute_type |
The type of an attribute. | |
Public Member Functions | |
multi_data_base () | |
Constructs the object. | |
virtual | ~multi_data_base () |
Destructs the object. | |
void | set_num_labels (int num) |
Sets the total number of labels. | |
int | num_attributes () const |
Returns the total number of attributes. | |
int | num_labels () const |
Returns the total number of labels. | |
int | num_features () const |
Returns the total number of features. | |
void | generate_bias_features (const attribute_type &a) |
Reserves bias features for all of possible labels. | |
void | generate_features () |
Finalize the data set. | |
Data Fields | |
int | m_num_labels |
The number of features. |
void classias::multi_data_base< instance_tmpl, feature_generator_tmpl >::set_num_labels | ( | int | num | ) | [inline] |
Sets the total number of labels.
num | The number of labels. |
int classias::multi_data_base< instance_tmpl, feature_generator_tmpl >::num_attributes | ( | ) | const [inline] |
Returns the total number of attributes.
Reimplemented from classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >.
Reimplemented in classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.
int classias::multi_data_base< instance_tmpl, feature_generator_tmpl >::num_labels | ( | ) | const [inline] |
Returns the total number of labels.
Reimplemented from classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >.
Reimplemented in classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.
int classias::multi_data_base< instance_tmpl, feature_generator_tmpl >::num_features | ( | ) | const [inline] |
Returns the total number of features.
Reimplemented from classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >.
Reimplemented in classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.
void classias::multi_data_base< instance_tmpl, feature_generator_tmpl >::generate_bias_features | ( | const attribute_type & | a | ) | [inline] |
Reserves bias features for all of possible labels.
a | The attribute identifier for the bias feature. |
Reimplemented in classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.
void classias::multi_data_base< instance_tmpl, feature_generator_tmpl >::generate_features | ( | ) | [inline] |
Finalize the data set.
This function generates features for pairs of attributes and labels.
Reimplemented in classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.