SG++-Doxygen-Documentation
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::Accuracy sgpp::datadriven::MSE sgpp::datadriven::NegativeLogLikelihood

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

◆ Metric() [1/3]

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

Default constructor.

◆ Metric() [2/3]

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

Copy constructor.

Parameters
rhsconst reference to the scorer object to copy from.

◆ Metric() [3/3]

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

Move constructor.

Parameters
rhsR-value reference to a scorer object to moved from.

◆ ~Metric()

virtual sgpp::datadriven::Metric::~Metric ( )
virtualdefault

virtual destructor.

Member Function Documentation

◆ clone()

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::NegativeLogLikelihood, sgpp::datadriven::Accuracy, and sgpp::datadriven::MSE.

◆ measure()

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::NegativeLogLikelihood, sgpp::datadriven::Accuracy, and sgpp::datadriven::MSE.

◆ operator=() [1/2]

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.

◆ operator=() [2/2]

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: