classias::candidate_data_base< instance_tmpl, feature_generator_tmpl > Class Template Reference

Inheritance diagram for classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >:

classias::binary_data_base< instance_tmpl > classias::candidate_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl > classias::multi_data_base< instance_tmpl, feature_generator_tmpl > classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >

Detailed Description

template<class instance_tmpl, class feature_generator_tmpl>
class classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >

A template class for a collection of candidate-classification instances.

This class represents a data set for training a candidate 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() to specify the total number of features.

Parameters:
instance_tmpl The type of an instance.
features_quark_tmpl The type of a feature quark.


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 binary_data_base<
instance_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.
typedef std::vector< int > positive_labels_type
 The type of a container for positive labels.

Public Member Functions

 candidate_data_base ()
 Constructs the object.
void append_positive_label (int l)
 Appends a positive label.
virtual ~candidate_data_base ()
 Destructs the object.
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.

Data Fields

positive_labels_type positive_labels
 A set of positive labels in the data set.
feature_generator_type feature_generator
 The feature generator.


Member Function Documentation

template<class instance_tmpl, class feature_generator_tmpl>
void classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >::append_positive_label ( int  l  )  [inline]

Appends a positive label.

Parameters:
l The positive label to append.

template<class instance_tmpl, class feature_generator_tmpl>
int classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >::num_attributes (  )  const [inline]

Returns the total number of attributes.

Returns:
int The total number of attributes.

Reimplemented from classias::binary_data_base< instance_tmpl >.

Reimplemented in classias::candidate_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >, classias::multi_data_base< instance_tmpl, feature_generator_tmpl >, and classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.

template<class instance_tmpl, class feature_generator_tmpl>
int classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >::num_labels (  )  const [inline]

Returns the total number of labels.

Returns:
int The total number of labels. This is always 0 for the data collection for candidate instances.

Reimplemented from classias::binary_data_base< instance_tmpl >.

Reimplemented in classias::candidate_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >, classias::multi_data_base< instance_tmpl, feature_generator_tmpl >, and classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.

template<class instance_tmpl, class feature_generator_tmpl>
int classias::candidate_data_base< instance_tmpl, feature_generator_tmpl >::num_features (  )  const [inline]

Returns the total number of features.

Returns:
int The total number of features.

Reimplemented from classias::binary_data_base< instance_tmpl >.

Reimplemented in classias::candidate_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >, classias::multi_data_base< instance_tmpl, feature_generator_tmpl >, and classias::multi_data_with_quark_base< instance_tmpl, attributes_quark_tmpl, labels_quark_tmpl, feature_generator_tmpl >.


Copyright (c) 2002-2009 by Naoaki Okazaki
Mon Dec 28 23:41:04 2009