#include <Classifier.h>
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. |
This class holds all the results obtained with computeResults(), which is equivalent to . It also offers two methods that allow the quick evaluation of the results.
Definition at line 117 of file Classifier.h.
|
The constructor. Initialize the index and the votes vector.
Definition at line 127 of file Classifier.h. |
|
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 < , >), which is sorted by the second element, resulting in a ranking of the votes per class.
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(). |
|
Get the winner.
Definition at line 145 of file Classifier.h. References Classifier::ExampleResults::getRankedList(). |
|
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
Definition at line 168 of file Classifier.h. References Classifier::ExampleResults::getRankedList(). |
|
The vector with the results. Equivalent to what returned by .
Definition at line 137 of file Classifier.h. Referenced by Classifier::ExampleResults::getRankedList(). |