SG++-Doxygen-Documentation
sgpp::datadriven::Scorer Class Reference

Base class for supervised learning used to fit a model and quantify accuracy using a sgpp::datadriven::Metric with either testing or cross validation. More...

#include <Scorer.hpp>

Public Member Functions

Scoreroperator= (const Scorer &rhs)=default
 Copy assign operator. More...
 
Scoreroperator= (Scorer &&rhs)=default
 Move assign operator. More...
 
 Scorer (Metric *metric)
 Constructor. More...
 
 Scorer (Scorer &&rhs)=default
 Move constructor. More...
 
double test (ModelFittingBase &model, Dataset &testDataset)
 evaluate the accuracy on the test set using the sgpp::datadriven::Metric. More...
 
 ~Scorer ()=default
 Destructor. More...
 

Detailed Description

Base class for supervised learning used to fit a model and quantify accuracy using a sgpp::datadriven::Metric with either testing or cross validation.

Splits a dataset into testing and training parts, trains the model and measures the accuracy.

Constructor & Destructor Documentation

sgpp::datadriven::Scorer::Scorer ( Metric metric)
explicit

Constructor.

Parameters
metricsgpp::datadriven::Metric to to quantify approximation quality of a trained model. Scorer will take ownership of this object. puts a random seed.
sgpp::datadriven::Scorer::Scorer ( Scorer &&  rhs)
default

Move constructor.

Parameters
rhsR-value reference to a scorer object to moved from.
sgpp::datadriven::Scorer::~Scorer ( )
default

Destructor.

Member Function Documentation

Scorer& sgpp::datadriven::Scorer::operator= ( const Scorer rhs)
default

Copy assign operator.

Parameters
rhsconst reference to the scorer object to copy from.
Returns
rerefernce to this with updated values.
Scorer& sgpp::datadriven::Scorer::operator= ( Scorer &&  rhs)
default

Move assign operator.

Parameters
rhsR-value reference to an a scorer object to move from.
Returns
rerefernce to this with updated values.
double sgpp::datadriven::Scorer::test ( ModelFittingBase model,
Dataset testDataset 
)

evaluate the accuracy on the test set using the sgpp::datadriven::Metric.

Parameters
modelmodel to be fitted based on the train dataset.
testDatasetdataset used quantify accuracy using sgpp::datadriven::Metric.
Returns
accuracy of the fit.

References sgpp::datadriven::ModelFittingBase::evaluate(), sgpp::datadriven::Dataset::getData(), sgpp::datadriven::Dataset::getNumberInstances(), and sgpp::datadriven::Dataset::getTargets().


The documentation for this class was generated from the following files: