SG++
sgpp::datadriven::ModelFittingDensityEstimation Class Reference

Fitter object that encapsulates the usage of sparse grid density estimation with identity as regularization. More...

#include <ModelFittingDensityEstimation.hpp>

Inheritance diagram for sgpp::datadriven::ModelFittingDensityEstimation:
sgpp::datadriven::ModelFittingBase

Public Member Functions

double evaluate (const DataVector &sample) const override
 Evaluate the fitted density at a single data point - requires a trained grid. More...
 
void evaluate (DataMatrix &samples, DataVector &results) override
 Evaluate the fitted density on a set of data points - requires a trained grid. More...
 
void fit (Dataset &dataset) override
 Fit the grid to the given dataset by determining the weights of the initial grid by the SGDE approach. More...
 
 ModelFittingDensityEstimation (const FitterConfigurationDensityEstimation &config)
 Constructor. More...
 
bool refine () override
 Improve accuracy of the fit on the given training data by adaptive refinement of the grid and recalculate weights. More...
 
void update (Dataset &dataset) override
 Train the grid of an existing model with new samples. More...
 
- Public Member Functions inherited from sgpp::datadriven::ModelFittingBase
const FitterConfigurationgetFitterConfiguration () const
 Get the configuration of the fitter object. More...
 
const GridgetGrid () const
 Get the underlying grid object for the current model. More...
 
const DataVectorgetSurpluses () const
 Get the surpluses of the current grid. More...
 
 ModelFittingBase ()
 Default constructor. More...
 
 ModelFittingBase (const ModelFittingBase &rhs)=delete
 Copy constructor - we cannot deep copy all member variables yet. More...
 
 ModelFittingBase (ModelFittingBase &&rhs)=default
 Move constructor. More...
 
ModelFittingBaseoperator= (const ModelFittingBase &rhs)=delete
 Copy assign operator - we cannot deep copy all member variables yet. More...
 
ModelFittingBaseoperator= (ModelFittingBase &&rhs)=default
 Move assign operator. More...
 
virtual ~ModelFittingBase ()=default
 virtual destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sgpp::datadriven::ModelFittingBase
GridbuildGrid (const RegularGridConfiguration &gridConfig) const
 Factory member function that generates a grid from configuration. More...
 
SLESolverbuildSolver (const SLESolverConfiguration &config) const
 Factory member function to build the solver for the least squares regression problem according to the config. More...
 
void reconfigureSolver (SLESolver &solver, const SLESolverConfiguration &config) const
 Configure solver based on the desired configuration. More...
 
- Protected Attributes inherited from sgpp::datadriven::ModelFittingBase
DataVector alpha
 hierarchical surpluses of the grid. More...
 
std::unique_ptr< FitterConfigurationconfig
 Configuration object for the fitter. More...
 
Datasetdataset
 Pointer to sgpp::datadriven::Dataset. More...
 
std::unique_ptr< Gridgrid
 the sparse grid that approximates the data. More...
 
std::unique_ptr< SLESolversolver
 Solver for the learning problem. More...
 

Detailed Description

Fitter object that encapsulates the usage of sparse grid density estimation with identity as regularization.

Allows usage of different grids, different solvers and different regularization techniques based on the provided configuration objects.

Constructor & Destructor Documentation

sgpp::datadriven::ModelFittingDensityEstimation::ModelFittingDensityEstimation ( const FitterConfigurationDensityEstimation config)
explicit

Member Function Documentation

double sgpp::datadriven::ModelFittingDensityEstimation::evaluate ( const DataVector sample) const
overridevirtual

Evaluate the fitted density at a single data point - requires a trained grid.

Parameters
samplevector with the coordinates in all dimensions of that sample.
Returns
evaluation of the trained grid.

Implements sgpp::datadriven::ModelFittingBase.

void sgpp::datadriven::ModelFittingDensityEstimation::evaluate ( DataMatrix samples,
DataVector results 
)
overridevirtual

Evaluate the fitted density on a set of data points - requires a trained grid.

Parameters
samplesmatrix where each row represents a sample and the columns contain the coordinates in all dimensions of that sample.
resultsvector where each row will contain the evaluation of the respective sample on the current model.

Implements sgpp::datadriven::ModelFittingBase.

void sgpp::datadriven::ModelFittingDensityEstimation::fit ( Dataset dataset)
overridevirtual

Fit the grid to the given dataset by determining the weights of the initial grid by the SGDE approach.

Parameters
datasetthe training dataset that is used to fit the model.

Implements sgpp::datadriven::ModelFittingBase.

References sgpp::datadriven::Dataset::getData().

Referenced by update().

bool sgpp::datadriven::ModelFittingDensityEstimation::refine ( )
overridevirtual

Improve accuracy of the fit on the given training data by adaptive refinement of the grid and recalculate weights.

Returns
true if refinement could be performed based on the refinement configuration, else false.

Implements sgpp::datadriven::ModelFittingBase.

void sgpp::datadriven::ModelFittingDensityEstimation::update ( Dataset dataset)
overridevirtual

Train the grid of an existing model with new samples.

Parameters
datasetthe training dataset that is used to fit the model.

Implements sgpp::datadriven::ModelFittingBase.

References fit().


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