SG++-Doxygen-Documentation
|
Abstract super class to encapsulate density estimation models such as using offline/-online splitting or conjugate gradients in order to solve the system. More...
#include <ModelFittingDensityEstimation.hpp>
Public Member Functions | |
virtual void | fit (DataMatrix &dataset)=0 |
Fit the grid to the given dataset by determining the surpluses of the initial grid by the SGDE approach. More... | |
sgpp::base::RefinementFunctor * | getRefinementFunctor () |
Returns the refinement functor suitable for the model settings. More... | |
ModelFittingDensityEstimation () | |
Default constructor. More... | |
virtual bool | refine (size_t newNoPoints, std::list< size_t > *deletedGridPoints)=0 |
Performs a refinement given the new grid size and the points to coarsened. More... | |
bool | refine () override |
Improve accuracy of the fit on the given training data by adaptive refinement of the grid and recalculate weights. More... | |
virtual void | update (DataMatrix &samples)=0 |
Updates the model based on new data samples (streaming, batch learning). More... | |
Public Member Functions inherited from sgpp::datadriven::ModelFittingBaseSingleGrid | |
Grid & | getGrid () |
Get the underlying grid object for the current model. More... | |
DataVector & | getSurpluses () |
Get the surpluses of the current grid. More... | |
ModelFittingBaseSingleGrid () | |
Default constructor. More... | |
ModelFittingBaseSingleGrid (const ModelFittingBaseSingleGrid &rhs)=delete | |
Copy constructor - we cannot deep copy all member variables yet. More... | |
ModelFittingBaseSingleGrid (ModelFittingBaseSingleGrid &&rhs)=default | |
Move constructor. More... | |
ModelFittingBaseSingleGrid & | operator= (const ModelFittingBaseSingleGrid &rhs)=delete |
Copy assign operator - we cannot deep copy all member variables yet. More... | |
ModelFittingBaseSingleGrid & | operator= (ModelFittingBaseSingleGrid &&rhs)=default |
Move assign operator. More... | |
virtual | ~ModelFittingBaseSingleGrid ()=default |
virtual destructor. More... | |
Public Member Functions inherited from sgpp::datadriven::ModelFittingBase | |
virtual double | evaluate (const DataVector &sample)=0 |
Evaluate the fitted model at a single data point. More... | |
virtual void | evaluate (DataMatrix &samples, DataVector &results)=0 |
Evaluate the fitted model on a set of data points. More... | |
virtual void | fit (Dataset &dataset)=0 |
Polymorphic clone pattern. More... | |
const FitterConfiguration & | getFitterConfiguration () const |
Get the configuration of the fitter object. 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... | |
ModelFittingBase & | operator= (const ModelFittingBase &rhs)=delete |
Copy assign operator - we cannot deep copy all member variables yet. More... | |
ModelFittingBase & | operator= (ModelFittingBase &&rhs)=default |
Move assign operator. More... | |
virtual void | reset ()=0 |
Resets the state of the entire model. More... | |
virtual void | update (Dataset &dataset)=0 |
Train the grid of an existing model with new samples. More... | |
virtual | ~ModelFittingBase ()=default |
virtual destructor. More... | |
Protected Member Functions | |
virtual bool | isRefinable ()=0 |
Function that indicates whether a model is refinable at all (certain on/off settings do not allow for refinement) More... | |
Protected Member Functions inherited from sgpp::datadriven::ModelFittingBase | |
Grid * | buildGrid (const RegularGridConfiguration &gridConfig) const |
Factory member function that generates a grid from configuration. More... | |
SLESolver * | buildSolver (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 | |
size_t | refinementsPerformed |
Count the amount of refinement operations performed on the current dataset. More... | |
Protected Attributes inherited from sgpp::datadriven::ModelFittingBaseSingleGrid | |
DataVector | alpha |
hierarchical surpluses of the grid. More... | |
std::unique_ptr< Grid > | grid |
the sparse grid that approximates the data. More... | |
Protected Attributes inherited from sgpp::datadriven::ModelFittingBase | |
std::unique_ptr< FitterConfiguration > | config |
Configuration object for the fitter. More... | |
Dataset * | dataset |
Pointer to sgpp::datadriven::Dataset. More... | |
std::unique_ptr< SLESolver > | solver |
Solver for the learning problem. More... | |
Additional Inherited Members | |
Public Attributes inherited from sgpp::datadriven::ModelFittingBase | |
bool | verboseSolver |
Whether the Solver produces output or not. More... | |
Abstract super class to encapsulate density estimation models such as using offline/-online splitting or conjugate gradients in order to solve the system.
sgpp::datadriven::ModelFittingDensityEstimation::ModelFittingDensityEstimation | ( | ) |
Default constructor.
|
pure virtual |
Fit the grid to the given dataset by determining the surpluses of the initial grid by the SGDE approach.
Requires only data samples and no targets (since those are irrelevant for the density estimation whatsoever)
dataset | the training dataset that is used to fit the model. |
Implemented in sgpp::datadriven::ModelFittingDensityEstimationCG, and sgpp::datadriven::ModelFittingDensityEstimationOnOff.
RefinementFunctor * sgpp::datadriven::ModelFittingDensityEstimation::getRefinementFunctor | ( | ) |
Returns the refinement functor suitable for the model settings.
References sgpp::datadriven::ModelFittingBaseSingleGrid::alpha, sgpp::datadriven::ModelFittingBase::config, and sgpp::base::AdaptivityConfiguration::refinementFunctorType.
Referenced by refine().
|
protectedpure virtual |
Function that indicates whether a model is refinable at all (certain on/off settings do not allow for refinement)
Implemented in sgpp::datadriven::ModelFittingDensityEstimationOnOff.
Referenced by refine().
|
pure virtual |
Performs a refinement given the new grid size and the points to coarsened.
newNoPoints | the grid size after refinement and coarsening |
deletedGridPoints | a list of indexes for grid points that will be removed |
Implemented in sgpp::datadriven::ModelFittingDensityEstimationCG, and sgpp::datadriven::ModelFittingDensityEstimationOnOff.
|
overridevirtual |
Improve accuracy of the fit on the given training data by adaptive refinement of the grid and recalculate weights.
Implements sgpp::datadriven::ModelFittingBase.
References getRefinementFunctor(), sgpp::datadriven::ModelFittingBaseSingleGrid::grid, isRefinable(), and refinementsPerformed.
|
pure virtual |
Updates the model based on new data samples (streaming, batch learning).
Requires only the data samples and no targets (since those are irrelevant for the density estimation whatsoever)
samples | the new data samples |
Implemented in sgpp::datadriven::ModelFittingDensityEstimationCG, and sgpp::datadriven::ModelFittingDensityEstimationOnOff.
|
protected |
Count the amount of refinement operations performed on the current dataset.
Referenced by refine(), sgpp::datadriven::ModelFittingDensityEstimationCG::reset(), and sgpp::datadriven::ModelFittingDensityEstimationOnOff::reset().