SG++
sgpp::datadriven::Metric Class Referenceabstract

We use metrics to quantify approximation quality of a trained model. More...

#include <Metric.hpp>

Inheritance diagram for sgpp::datadriven::Metric:
sgpp::datadriven::MSE

Public Member Functions

virtual Metricclone () const =0
 Polymorphic clone pattern. More...
 
virtual double measure (const DataVector &predictedValues, const DataVector &trueValues) const =0
 Quantify the difference between predicted values and actual values. More...
 
 Metric ()=default
 Default constructor. More...
 
 Metric (const Metric &rhs)=default
 Copy constructor. More...
 
 Metric (Metric &&rhs)=default
 Move constructor. More...
 
Metricoperator= (const Metric &rhs)=default
 Copy assign operator. More...
 
Metricoperator= (Metric &&rhs)=default
 Move assign operator. More...
 
virtual ~Metric ()=default
 virtual destructor. More...
 

Detailed Description

We use metrics to quantify approximation quality of a trained model.

It should be calculated in the way that smaller is always better. This means, for example that classification accuracy should be negated.

Constructor & Destructor Documentation

sgpp::datadriven::Metric::Metric ( )
default

Default constructor.

sgpp::datadriven::Metric::Metric ( const Metric rhs)
default

Copy constructor.

Parameters
rhsconst reference to the scorer object to copy from.
sgpp::datadriven::Metric::Metric ( Metric &&  rhs)
default

Move constructor.

Parameters
rhsR-value reference to a scorer object to moved from.
virtual sgpp::datadriven::Metric::~Metric ( )
virtualdefault

virtual destructor.

Member Function Documentation

virtual Metric* sgpp::datadriven::Metric::clone ( ) const
pure virtual

Polymorphic clone pattern.

Returns
deep copy of this object. New object is owned by caller.

Implemented in sgpp::datadriven::MSE.

virtual double sgpp::datadriven::Metric::measure ( const DataVector predictedValues,
const DataVector trueValues 
) const
pure virtual

Quantify the difference between predicted values and actual values.

Does not have an inner state.

Parameters
predictedValuesvalues calculated by the model for testing data
trueValuesactual values as taken from the dataset.
Returns
Quantification of the difference. Smaller is better.

Implemented in sgpp::datadriven::MSE.

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

Copy assign operator.

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

Move assign operator.

Parameters
rhsR-value reference to an a scorer object to move from.
Returns
rerefernce to this with updated values.

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