classias::classify::linear_binary_hinge< model_tmpl > Class Template Reference

Inheritance diagram for classias::classify::linear_binary_hinge< model_tmpl >:

classias::classify::linear_binary< model_tmpl >

Detailed Description

template<class model_tmpl>
class classias::classify::linear_binary_hinge< model_tmpl >

A template class for linear binary classifiers with hinge error function.

This template class implements a loss function for training algorithms.

Parameters:
model_tmpl The type of a model (container of feature weights). Any type that yields a feature weight with operator [] is usable (e.g., arrays, std::vector, std::map).


Public Types

typedef model_tmpl model_type
 The type of a model.
typedef model_type::value_type value_type
 The type of a feature weight.
typedef linear_binary< model_tmpl > base_type
 Tne type of the base class.

Public Member Functions

 linear_binary_hinge (model_type &model)
 Constructs an object.
virtual ~linear_binary_hinge ()
 Destructs an object.
value_type error (bool b) const
 Computes the error of the classification result.
value_type error (bool b, value_type &loss) const
 Computes the error and loss of the classification result.

Static Public Member Functions

static const char * name ()
 Returns the name of this classifier.


Constructor & Destructor Documentation

template<class model_tmpl>
classias::classify::linear_binary_hinge< model_tmpl >::linear_binary_hinge ( model_type model  )  [inline]

Constructs an object.

Parameters:
model The model associated with the classifier.


Member Function Documentation

template<class model_tmpl>
value_type classias::classify::linear_binary_hinge< model_tmpl >::error ( bool  b  )  const [inline]

Computes the error of the classification result.

Parameters:
b The reference label for this instance.
Returns:
value_type The error.

template<class model_tmpl>
value_type classias::classify::linear_binary_hinge< model_tmpl >::error ( bool  b,
value_type loss 
) const [inline]

Computes the error and loss of the classification result.

Parameters:
b The reference label for this instance.
loss The loss.
Returns:
value_type The error.

template<class model_tmpl>
static const char* classias::classify::linear_binary_hinge< model_tmpl >::name (  )  [inline, static]

Returns the name of this classifier.

Returns:
const char* The name of the classifier.

Reimplemented from classias::classify::linear_binary< model_tmpl >.


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