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. |
void classias::accuracy::set | ( | bool | b | ) | [inline] |
Increments the number of correct/incorrect instances.
b | A truth of an instance. |
classias::accuracy::operator double | ( | ) | const [inline] |
Gets the accuracy.
void classias::accuracy::output | ( | std::ostream & | os | ) | const [inline] |
Outputs the accuracy score.
os | The output stream. |