Classifier::ExampleResults Class Reference

Holds the results per example. More...

#include <Classifier.h>

List of all members.

Public Member Functions

 ExampleResults (const int idx, const int numClasses)
 The constructor.
pair< int, double > getWinner (const int rank=0)
 Get the winner.
bool isWinner (const int idxRealClass, const int atLeastRank=0) const
 Checks if the given class is the winner class.

Public Attributes

int idx
 The index of the example.
vector< double > votesVector
 The vector with the results.

Private Member Functions

void getRankedList (vector< pair< int, double > > &rankedList) const
 Create a sorted ranking list.


Detailed Description

Holds the results per example.

This class holds all the results obtained with computeResults(), which is equivalent to ${\bf g}(x)$ . It also offers two methods that allow the quick evaluation of the results.

Date:
16/11/2005

Definition at line 117 of file Classifier.h.


Constructor & Destructor Documentation

ExampleResults const int  idx,
const int  numClasses
[inline]
 

The constructor.

Initialize the index and the votes vector.

Parameters:
idx The index of the example.
numClasses The number of classes.
Date:
16/11/2005

Definition at line 127 of file Classifier.h.


Member Function Documentation

void getRankedList vector< pair< int, double > > &  rankedList  )  const [inline, private]
 

Create a sorted ranking list.

It uses votesVector to build a vector of pairs that contains the index of the class and the value of the votes (that is a vector of <$\ell$ , $g_\ell(x)$ >), which is sorted by the second element, resulting in a ranking of the votes per class.

Parameters:
rankedList the vector that will be filled with the rankings.
Date:
16/11/2005

Definition at line 194 of file Classifier.h.

References Classifier::computeResults(), Classifier::getClassError(), Classifier::getOverallError(), and Classifier::ExampleResults::votesVector.

Referenced by Classifier::ExampleResults::getWinner(), and Classifier::ExampleResults::isWinner().

pair<int, double> getWinner const int  rank = 0  )  [inline]
 

Get the winner.

Parameters:
rank The rank. 0 = winner. 1 = second, etc..
Returns:
A pair <$\ell$ , $g_\ell(x)$ >, where $\ell$ is the class index.
Date:
16/11/2005

Definition at line 145 of file Classifier.h.

References Classifier::ExampleResults::getRankedList().

bool isWinner const int  idxRealClass,
const int  atLeastRank = 0
const [inline]
 

Checks if the given class is the winner class.

Example: if the ranking is 5 2 6 3 1 4 (in class indexes):

 isWinner(5,0); // -> true
 isWinner(2,0); // -> false
 isWinner(2,1); // -> true
 isWinner(3,3); // -> true
Parameters:
idxRealClass The index of the real class.
atLeastRank The maximum rank in which the class must be to be considered a "winner".
Date:
16/11/2005

Definition at line 168 of file Classifier.h.

References Classifier::ExampleResults::getRankedList().


Member Data Documentation

vector<double> votesVector
 

The vector with the results.

Equivalent to what returned by ${\bf g}(x)$ .

Remarks:
It is public because the methods of Classifier will access it directly.

Definition at line 137 of file Classifier.h.

Referenced by Classifier::ExampleResults::getRankedList().


The documentation for this class was generated from the following file:
Generated on Mon Nov 28 21:43:47 2005 for MultiBoost by  doxygen 1.4.5