classias::binary_instance_base< features_tmpl, weight_tmpl, group_tmpl > Class Template Reference


Detailed Description

template<class features_tmpl, class weight_tmpl = weight_base, class group_tmpl = group_base>
class classias::binary_instance_base< features_tmpl, weight_tmpl, group_tmpl >

A template class for binary instances.

This class implements an instance for binary classification. An instance for binary classification consists of a feature vector (implemented by features_tmpl) and a binary label (implemented in this class). In addition, an instance class exposes the interfaces for instance weighting (implemented by weight_tmpl) and instance group numbers (implemented by group_tmpl).

Parameters:
features_tmpl The type of a feature (=attribute) vector.
weight_tmpl The base class implementing instance weighting. By default, this class uses weight_base.
group_tmpl The base class implementing group numbers. By default, this class uses group_base.
See also:
sparse_vector_base, weight_base, group_base.


Public Types

typedef features_tmpl features_type
 The type of a feature vector.
typedef weight_tmpl weight_type
 The type of a weight interface.
typedef group_tmpl group_type
 The type of a group instance.
typedef features_type::identifier_type attribute_type
 The type of an attribute identifier.
typedef features_type::value_type value_type
 The type of an attribute value.

Public Member Functions

 binary_instance_base ()
 Constructs an object.
virtual ~binary_instance_base ()
 Destructs an object.
void set_label (bool l)
 Sets the boolean label of the instance.
bool get_label () const
 Gets the boolean label of the instance.

Protected Attributes

bool m_label
 The label (truth) of this instance.


Member Function Documentation

template<class features_tmpl, class weight_tmpl = weight_base, class group_tmpl = group_base>
void classias::binary_instance_base< features_tmpl, weight_tmpl, group_tmpl >::set_label ( bool  l  )  [inline]

Sets the boolean label of the instance.

Parameters:
l The boolean label.

template<class features_tmpl, class weight_tmpl = weight_base, class group_tmpl = group_base>
bool classias::binary_instance_base< features_tmpl, weight_tmpl, group_tmpl >::get_label (  )  const [inline]

Gets the boolean label of the instance.

Returns:
bool The boolean label of this instance.


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