#include <OutputInfo.h>
Public Member Functions | |
OutputInfo (const string &outputInfoFile) | |
The constructor. | |
void | outputIteration (const int t) |
Just output the iteration number. | |
void | outputError (InputData *pData, BaseLearner *pWeakHypothesis) |
Output the error of the given data. | |
void | outputMargins (InputData *pData, BaseLearner *pWeakHypothesis) |
Output the minimum margin the sum of below zero margins. | |
void | outputEdge (InputData *pData, BaseLearner *pWeakHypothesis) |
Output the edge. | |
void | endLine () |
End of line in the file stream. | |
Protected Types | |
typedef vector< vector< double > > | table |
A table representing the votes for each example. | |
Protected Attributes | |
ofstream | _outStream |
The output stream. | |
map< InputData *, table > | _gTableMap |
Maps the data to its g(x) table. | |
map< InputData *, table > | _margins |
Maps the data to the margins table. | |
map< InputData *, double > | _alphaSums |
Maps the data to the sum of the alpha. |
With this class it is possible to output and update the error rates, margins and the edge. These function must be called at each iteration with the newly found weak hypothesis, but before the update of the weights.
Definition at line 58 of file OutputInfo.h.
|
A table representing the votes for each example. Example: Ex_1: Class 0, Class 1, Class 2, .. , Class k Ex_2: Class 0, Class 1, Class 2, .. , Class k .. Ex_n: Class 0, Class 1, Class 2, .. , Class k
Definition at line 156 of file OutputInfo.h. |
|
The constructor. Create the object and open the output file.
Definition at line 31 of file OutputInfo.cpp. References OutputInfo::_outStream. |
|
End of line in the file stream. Call it when all the needed information has been outputted.
Definition at line 142 of file OutputInfo.h. References OutputInfo::_outStream. Referenced by Classifier::computeResults(). |
|
Output the edge. It is the measure of the accuracy of the current weak hypothesis relative to random guessing, and is defined as
Definition at line 176 of file OutputInfo.cpp. References OutputInfo::_outStream, BaseLearner::classify(), InputData::getBinaryClass(), ClassMappings::getNumClasses(), InputData::getNumExamples(), and InputData::getWeight(). |
|
Output the error of the given data. The error is computed by holding the information on the previous weak hypotheses. In AdaBoost, the error is computed with the formula
we therefore update the vector (for each example) each time this method is called:
Definition at line 54 of file OutputInfo.cpp. References OutputInfo::_gTableMap, ClassMappings::getNumClasses(), and InputData::getNumExamples(). Referenced by Classifier::computeResults(). |
|
Just output the iteration number.
Definition at line 47 of file OutputInfo.cpp. References OutputInfo::_outStream. Referenced by Classifier::computeResults(). |
|
Output the minimum margin the sum of below zero margins. These two elements are useful for an analysis of the training process. The margins are represent the per-class weighted correct rate, that is
The fist value that this method outputs is the minimum margin, that is
which is normalized by the sum of alpha
This can give a useful measure of the size of the functional margin. The second value which this method outputs is simply the sum of the margins below zero.
Definition at line 111 of file OutputInfo.cpp. References ClassMappings::getNumClasses(). |
|
Maps the data to the sum of the alpha. It is needed to keep this information saved from iteration to iteration.
Definition at line 187 of file OutputInfo.h. |
|
Maps the data to its g(x) table. It is needed to keep this information saved from iteration to iteration.
Definition at line 168 of file OutputInfo.h. Referenced by OutputInfo::outputError(). |
|
Maps the data to the margins table. It is needed to keep this information saved from iteration to iteration.
Definition at line 178 of file OutputInfo.h. |