classias::accuracy Class Reference


Detailed Description

Accuracy counter.

This class counts the number of true instances and the total number of instances. Call set() with a boolean argument indicating whether the classification for an instance is successful (true) or not (false).


Public Member Functions

 accuracy ()
 Constructs an object.
virtual ~accuracy ()
 Destructs the object.
void set (bool b)
 Increments the number of correct/incorrect instances.
 operator double () const
 Gets the accuracy.
void output (std::ostream &os) const
 Outputs the accuracy score.

Protected Attributes

int m_m
 The number of matches.
int m_n
 The total number of instances.


Member Function Documentation

void classias::accuracy::set ( bool  b  )  [inline]

Increments the number of correct/incorrect instances.

Parameters:
b A truth of an instance.

classias::accuracy::operator double (  )  const [inline]

Gets the accuracy.

Returns:
double The accuracy.

void classias::accuracy::output ( std::ostream &  os  )  const [inline]

Outputs the accuracy score.

Parameters:
os The output stream.


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