An auxiliary class for cross-validation. More...
Public Types | |
using | MIE = MetaInfoExtractor< MLAlgorithm, MatType, PredictionsType, WeightsType > |
A short alias for MetaInfoExtractor. More... | |
Public Member Functions | |
CVBase () | |
Assert that MLAlgorithm doesn't take any additional basic parameters like numClasses. More... | |
CVBase (const size_t numClasses) | |
Assert that MLAlgorithm takes the numClasses parameter and store it. More... | |
CVBase (const data::DatasetInfo &datasetInfo, const size_t numClasses) | |
Assert that MLAlgorithm takes the numClasses parameter and a data::DatasetInfo parameter and store them. More... | |
template<typename... MLAlgorithmArgs> | |
MLAlgorithm | Train (const MatType &xs, const PredictionsType &ys, const MLAlgorithmArgs &... args) |
Train MLAlgorithm with given data points, predictions, and hyperparameters depending on what CVBase constructor has been called. More... | |
template<typename... MLAlgorithmArgs> | |
MLAlgorithm | Train (const MatType &xs, const PredictionsType &ys, const WeightsType &weights, const MLAlgorithmArgs &... args) |
Train MLAlgorithm with given data points, predictions, weights, and hyperparameters depending on what CVBase constructor has been called. More... | |
Static Public Member Functions | |
static void | AssertDataConsistency (const MatType &xs, const PredictionsType &ys) |
Assert there is the equal number of data points and predictions. More... | |
static void | AssertWeightsConsistency (const MatType &xs, const WeightsType &weights) |
Assert weighted learning is supported and there is the equal number of data points and weights. More... | |
An auxiliary class for cross-validation.
It serves to handle basic non-data constructor parameters of a machine learning algorithm (like datasetInfo or numClasses) and to assert that the machine learning algorithm and data satisfy certain conditions.
This class is not meant to be used directly by users. To cross-validate rather use end-user classes like SimpleCV or KFoldCV.
MLAlgorithm | A machine learning algorithm. |
MatType | The type of data. |
PredictionsType | The type of predictions (labels/responses). |
WeightsType | The type of weights. It supposed to be void* when weights are not supported. |
Definition at line 39 of file cv_base.hpp.
using MIE = MetaInfoExtractor<MLAlgorithm, MatType, PredictionsType, WeightsType> |
A short alias for MetaInfoExtractor.
Definition at line 44 of file cv_base.hpp.
CVBase | ( | ) |
Assert that MLAlgorithm doesn't take any additional basic parameters like numClasses.
CVBase | ( | const size_t | numClasses | ) |
Assert that MLAlgorithm takes the numClasses parameter and store it.
numClasses | Number of classes in the dataset. |
CVBase | ( | const data::DatasetInfo & | datasetInfo, |
const size_t | numClasses | ||
) |
Assert that MLAlgorithm takes the numClasses parameter and a data::DatasetInfo parameter and store them.
datasetInfo | Type information for each dimension of the dataset. |
numClasses | Number of classes in the dataset. |
|
static |
Assert there is the equal number of data points and predictions.
|
static |
Assert weighted learning is supported and there is the equal number of data points and weights.
MLAlgorithm Train | ( | const MatType & | xs, |
const PredictionsType & | ys, | ||
const MLAlgorithmArgs &... | args | ||
) |
Train MLAlgorithm with given data points, predictions, and hyperparameters depending on what CVBase constructor has been called.
MLAlgorithm Train | ( | const MatType & | xs, |
const PredictionsType & | ys, | ||
const WeightsType & | weights, | ||
const MLAlgorithmArgs &... | args | ||
) |
Train MLAlgorithm with given data points, predictions, weights, and hyperparameters depending on what CVBase constructor has been called.