#include <shark/Data/CVDatasetTools.h>
#include <shark/Data/DataDistribution.h>
#include <shark/Models/LinearModel.h>
#include <shark/Models/ConcatenatedModel.h>
#include <shark/ObjectiveFunctions/ErrorFunction.h>
#include <shark/ObjectiveFunctions/Loss/SquaredLoss.h>
#include <shark/ObjectiveFunctions/Regularizer.h>
#include <shark/Algorithms/GradientDescent/Rprop.h>
Go to the source code of this file.
Functions | |
double | trainProblem (const RegressionDataset &training, RegressionDataset const &validation, double regularization) |
int | main () |
int main | ( | ) |
What is Cross Validation(CV)? In Cross Validation the dataset is partitioned in several validation data sets. For a given validation dataset the remainder of the dataset
Definition at line 63 of file CVFolds.cpp.
References shark::createCVSameSize(), shark::LabeledDataDistribution< InputType, LabelType >::generateDataset(), shark::CVFolds< DatasetTypeT >::size(), shark::CVFolds< DatasetTypeT >::training(), trainProblem(), and shark::CVFolds< DatasetTypeT >::validation().
double trainProblem | ( | const RegressionDataset & | training, |
RegressionDataset const & | validation, | ||
double | regularization | ||
) |
In this example, you will learn to create and use partitions for cross validation. This tutorial describes a handmade solution which does not use the Crossvalidation error function which is also provided by shark. We do this, because it gives a better on what Cross Validation does. The Test Problem receives the regularization parameter and a dataset and returns the errror. skip to the main if you are not interested in the problem itself. But here you can also see how to create regularized error functions. so maybe it's still worth taking a look ;)
Definition at line 28 of file CVFolds.cpp.
References shark::ErrorFunction::init(), shark::IRpropPlus::init(), shark::initRandomUniform(), shark::LabeledData< InputT, LabelT >::inputs(), shark::LabeledData< InputT, LabelT >::labels(), shark::ErrorFunction::setRegularizer(), and shark::IRpropPlus::step().
Referenced by main().