SG++-Doxygen-Documentation
Loading...
Searching...
No Matches
sgpp::datadriven::NegativeLogLikelihood Class Reference

Metric that quantifies the likelihood of a dataset given the density function. More...

#include <NegativeLogLikelihood.hpp>

Inheritance diagram for sgpp::datadriven::NegativeLogLikelihood:
sgpp::datadriven::Metric

Public Member Functions

Metricclone () const override
 Standard clone method.
 
double measure (const DataVector &predictedValues, const DataVector &trueValues, const ModelFittingBase &model, Dataset &testDataset) const override
 Quantify the NLL of the predicted values (i.e.
 
double measureLowerIsBetter (const DataVector &predictedValues, const DataVector &trueValues, const ModelFittingBase &model, Dataset &testDataset) const override
 Quantify the NLL of the predicted values (i.e.
 
- Public Member Functions inherited from sgpp::datadriven::Metric
 Metric ()=default
 Default constructor.
 
 Metric (const Metric &rhs)=default
 Copy constructor.
 
 Metric (Metric &&rhs)=default
 Move constructor.
 
Metricoperator= (const Metric &rhs)=default
 Copy assign operator.
 
Metricoperator= (Metric &&rhs)=default
 Move assign operator.
 
virtual ~Metric ()=default
 virtual destructor.
 

Detailed Description

Metric that quantifies the likelihood of a dataset given the density function.

The smaller the negative log likelihood the better the fit

Member Function Documentation

◆ clone()

Metric * sgpp::datadriven::NegativeLogLikelihood::clone ( ) const
overridevirtual

Standard clone method.

Returns
the cloned metric instance

Implements sgpp::datadriven::Metric.

◆ measure()

double sgpp::datadriven::NegativeLogLikelihood::measure ( const DataVector predictedValues,
const DataVector trueValues,
const ModelFittingBase model,
Dataset testDataset 
) const
overridevirtual

Quantify the NLL of the predicted values (i.e.

adding the logs of the predicted values and ignorign the true values). Note that probabilities <= 0 are simply ignored (the model can provide those)

Parameters
predictedValuesprobabilites calculated by the model for testing data
trueValuesignored
modelreference to the model
testDatasetdataset with test data
Returns
the negative log likelihood of the predicted probabilities

Implements sgpp::datadriven::Metric.

References sgpp::base::DataVector::get().

Referenced by measureLowerIsBetter().

◆ measureLowerIsBetter()

double sgpp::datadriven::NegativeLogLikelihood::measureLowerIsBetter ( const DataVector predictedValues,
const DataVector trueValues,
const ModelFittingBase model,
Dataset testDataset 
) const
overridevirtual

Quantify the NLL of the predicted values (i.e.

adding the logs of the predicted values and ignorign the true values). Note that probabilities <= 0 are simply ignored (the model can provide those)

Parameters
predictedValuesprobabilites calculated by the model for testing data
trueValuesignored
modelreference to the model
testDatasetdataset with test data
Returns
the negative log likelihood of the predicted probabilities

Implements sgpp::datadriven::Metric.

References measure().


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