Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::ConfusionMatrix Class Reference

#include <ConfusionMatrix.h>

Inheritance diagram for prapi::ConfusionMatrix:

Matrix< int > Object List of all members.

Detailed Description

ConfusionMatrix is a class for representing classification results.

It provides methods for calculating error rates for different classes and for the whole matrix. A ConfusionMatrix can be printed in a human-readable format.


Public Methods

 ConfusionMatrix (int size=1)
 Create an initially empty size-by-size confusion matrix.

template<class T, class I, class C>  ConfusionMatrix (const util::List< Sample< T, I, C > > &lst, int classCount=-1) throw (util::InvalidArgumentException&)
 Create a confusion matrix out of a list of classified samples.

void print (std::ostream &out, const util::List< std::string > &lst, int space=4) const
 Print the confusion matrix to the given output stream.

double getError () const
 Get the error percentage for the whole confusion matrix.

double getError (int row) const
 Get the error percentage for a row in the matrix.

double getMixup (int column) const
 Get the mixup percentage for a column.


Constructor & Destructor Documentation

template<class T, class I, class C>
prapi::ConfusionMatrix::ConfusionMatrix const util::List< Sample< T, I, C > > &    lst,
int    classCount = -1
throw (util::InvalidArgumentException&)
 

Create a confusion matrix out of a list of classified samples.

Parameters:
lst  a list of classified samples
classCount  the number of classes (-1 to determine automatically)


Member Function Documentation

double prapi::ConfusionMatrix::getMixup int    column const
 

Get the mixup percentage for a column.

The mixup percentage tells the fraction of correctly classified samples among all samples classified to a certain class.

void prapi::ConfusionMatrix::print std::ostream &    out,
const util::List< std::string > &    lst,
int    space = 4
const
 

Print the confusion matrix to the given output stream.

The class names will be taken from lst, and indicated amount of space is reserved for each matrix column.

Parameters:
out  the output stream
lst  list of classes
space  column width-1 (maximum length of a matrix entry represented as a decimal number)


The documentation for this class was generated from the following files:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.