SG++-Doxygen-Documentation
sgpp::datadriven::ModelFittingClassification Class Reference

Fitter object that encapsulates density based classification using instances of ModelFittingDensityEstimation for each class. More...

#include <ModelFittingClassification.hpp>

Inheritance diagram for sgpp::datadriven::ModelFittingClassification:
sgpp::datadriven::ModelFittingBase

Public Member Functions

double evaluate (const DataVector &sample) override
 Predict the class of a data sample based on the density of the sample for each model. More...
 
void evaluate (DataMatrix &samples, DataVector &results) override
 Predicts the class for a set of data points based on the learned densities for each class. More...
 
void fit (Dataset &dataset) override
 Fits the models for all classes based on the data given in the dataset parameter. More...
 
 ModelFittingClassification (const FitterConfigurationClassification &config)
 Constructor. More...
 
bool refine () override
 Improve the accuracy of the classification by refining the grids of each class. More...
 
void reset () override
 Resets the state of the entire model. More...
 
void update (Dataset &dataset) override
 Updates the models for each class based on new data (streaming or batch learning) More...
 
- Public Member Functions inherited from sgpp::datadriven::ModelFittingBase
const FitterConfigurationgetFitterConfiguration () 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...
 
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

- Public Attributes inherited from sgpp::datadriven::ModelFittingBase
bool verboseSolver
 Whether the Solver produces output or not. More...
 
- 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
std::unique_ptr< FitterConfigurationconfig
 Configuration object for the fitter. More...
 
Datasetdataset
 Pointer to sgpp::datadriven::Dataset. More...
 
std::unique_ptr< SLESolversolver
 Solver for the learning problem. More...
 

Detailed Description

Fitter object that encapsulates density based classification using instances of ModelFittingDensityEstimation for each class.

Constructor & Destructor Documentation

sgpp::datadriven::ModelFittingClassification::ModelFittingClassification ( const FitterConfigurationClassification config)
explicit

Constructor.

Parameters
configconfiguration object that specifies grid, refinement, and regularization

References sgpp::datadriven::ModelFittingBase::config.

Member Function Documentation

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

Predict the class of a data sample based on the density of the sample for each model.

Parameters
samplethe sample point to classify
Returns
the predicted class label

Implements sgpp::datadriven::ModelFittingBase.

References sgpp::datadriven::ModelFittingBase::config, and friedman::p.

Referenced by evaluate().

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

Predicts the class for a set of data points based on the learned densities for each class.

Parameters
samplesmatrix where each row represents a data sample
resultsvector to output the predicted classes

Implements sgpp::datadriven::ModelFittingBase.

References evaluate(), sgpp::base::DataMatrix::getNcols(), sgpp::base::DataMatrix::getNrows(), sgpp::base::DataMatrix::getRow(), python.statsfileInfo::i, sgpp::base::DataVector::set(), and analyse_erg::tmp.

bool sgpp::datadriven::ModelFittingClassification::refine ( )
overridevirtual
void sgpp::datadriven::ModelFittingClassification::reset ( )
overridevirtual

Resets the state of the entire model.

Implements sgpp::datadriven::ModelFittingBase.

Referenced by fit().


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