#include <SortedData.h>
Inheritance diagram for SortedData:
Public Member Functions | |
void | load (const string &fileName, const eInputType inputType=IT_TRAIN, const int verboseLevel=1) |
Overloading of the load function to support sorting. | |
vpIterator | getSortedBegin (const int colIdx) |
Get the first element of the (sorted) column of the data. | |
vpIterator | getSortedEnd (const int colIdx) |
Get the last element of the (sorted) column of the data. | |
Protected Types | |
typedef vector< pair< int, double > > | column |
A column of the data. | |
Protected Attributes | |
vector< column > | _sortedData |
the sorted data. |
This is particularly useful for stump-based learner, because they work column-by-column (dimension-by-dimension), looking for a threshold that minimizes the error, and sorting the data it's mandatory. The connection between this class and the weak learner that implements decision stump, is done with the overriding of method BaseLearner::createInputData() which will return the desired InputData type (and which might depend on the arguments of the command line too).
Definition at line 56 of file SortedData.h.
|
A column of the data. The pair represents the index of the example and the value of the column. The index of the column is the index of the vector itself.
Definition at line 98 of file SortedData.h. |
|
Get the first element of the (sorted) column of the data.
Definition at line 76 of file SortedData.h. References SortedData::_sortedData. |
|
Get the last element of the (sorted) column of the data.
Definition at line 85 of file SortedData.h. References SortedData::_sortedData. |
|
Overloading of the load function to support sorting.
Reimplemented from InputData. Definition at line 32 of file SortedData.cpp. References InputData::_data, InputData::_numColumns, InputData::_numExamples, SortedData::_sortedData, nor_utils::comparePairOnSecond(), MultiBoost::IT_TEST, and InputData::load(). |