SG++-Doxygen-Documentation
sgpp::datadriven::FitterFactory Class Referenceabstract

Abstract factory to build all kinds of fitters/models based on a given configuration. More...

#include <FitterFactory.hpp>

Inheritance diagram for sgpp::datadriven::FitterFactory:
sgpp::datadriven::DensityEstimationFitterFactory sgpp::datadriven::LeastSquaresRegressionFitterFactory

Public Member Functions

virtual ModelFittingBasebuildFitter ()=0
 Assemble a sgpp::datadriven::ModelFittingBase object based on the configuration determined by a previous set_() call. More...
 
 FitterFactory ()=default
 Default constructor. More...
 
BOConfig getBOConfig ()
 Gets a compact representation of the hyperparameter configuration space. More...
 
virtual void getConfigBits (std::vector< ConfigurationBit *> &configBits)
 Setup connection to hyperparameter classes for modifying them through boolean represenations. More...
 
std::string printConfig ()
 Outputs information about the current hyperparameter configuration. More...
 
std::string printHeadline ()
 Outputs the names of the hyperparameters. More...
 
void setBO (BOConfig &config)
 Adjusts current hyperparameter configuration according to the input. More...
 
void setHarmonica ()
 Adjusts the current hyperparameter configuration according to the configBits. More...
 
virtual ~FitterFactory ()=default
 Virtual destructor. More...
 

Protected Attributes

std::vector< base::GridTypebasisFunctions
 Container for GridTypes specifically for the basis function hyperparameter. More...
 
std::vector< int > catOptions
 numer of options for all categorical parameters More...
 
std::map< std::string, DiscreteParametercatpar
 map to store hyperparameters defined on a discrete domain without inherent ordering (categorical) More...
 
std::map< std::string, ContinuousParameterconpar
 map to store hyperparameters defined on a continuous domain More...
 
std::vector< int > discOptions
 number of options for all discrete parameters More...
 
std::map< std::string, DiscreteParameterdispar
 map to store hyperparameters defined on a discrete domain More...
 

Detailed Description

Abstract factory to build all kinds of fitters/models based on a given configuration.

Constructor & Destructor Documentation

◆ FitterFactory()

sgpp::datadriven::FitterFactory::FitterFactory ( )
default

Default constructor.

◆ ~FitterFactory()

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

Virtual destructor.

Member Function Documentation

◆ buildFitter()

virtual ModelFittingBase* sgpp::datadriven::FitterFactory::buildFitter ( )
pure virtual

Assemble a sgpp::datadriven::ModelFittingBase object based on the configuration determined by a previous set_() call.

Returns
Fully configured instance of a sgpp::datadriven::ModelFittingBase object.

Implemented in sgpp::datadriven::DensityEstimationFitterFactory, and sgpp::datadriven::LeastSquaresRegressionFitterFactory.

Referenced by sgpp::datadriven::Harmonica::prepareConfigs().

◆ getBOConfig()

BOConfig sgpp::datadriven::FitterFactory::getBOConfig ( )

Gets a compact representation of the hyperparameter configuration space.

Returns
Object of type BOConfig that can be cloned to create different hyperparameter configurations

References catOptions, catpar, conpar, discOptions, and dispar.

◆ getConfigBits()

void sgpp::datadriven::FitterFactory::getConfigBits ( std::vector< ConfigurationBit *> &  configBits)
virtual

Setup connection to hyperparameter classes for modifying them through boolean represenations.

Parameters
configBitsreference to the boolean "configBits"

References catpar, conpar, and dispar.

Referenced by sgpp::datadriven::Harmonica::Harmonica().

◆ printConfig()

std::string sgpp::datadriven::FitterFactory::printConfig ( )

Outputs information about the current hyperparameter configuration.

Returns
String to print to console or file containing values of manipulated hyperparameters.

References basisFunctions, catpar, conpar, dispar, create_scripts::s, and sgpp::datadriven::GridTypeParser::toString().

Referenced by sgpp::datadriven::Harmonica::prepareConfigs().

◆ printHeadline()

std::string sgpp::datadriven::FitterFactory::printHeadline ( )

Outputs the names of the hyperparameters.

Returns
string to pringt ot console or file containing comma seperated names

References catpar, conpar, dispar, and create_scripts::s.

◆ setBO()

void sgpp::datadriven::FitterFactory::setBO ( BOConfig config)

Adjusts current hyperparameter configuration according to the input.

Parameters
configcompact representation of hyperparameters

References catpar, conpar, dispar, sgpp::datadriven::BOConfig::getCat(), sgpp::datadriven::BOConfig::getCont(), sgpp::datadriven::BOConfig::getDisc(), and python.statsfileInfo::i.

◆ setHarmonica()

void sgpp::datadriven::FitterFactory::setHarmonica ( )

Adjusts the current hyperparameter configuration according to the configBits.

References catpar, conpar, and dispar.

Referenced by sgpp::datadriven::Harmonica::setParameters().

Member Data Documentation

◆ basisFunctions

std::vector<base::GridType> sgpp::datadriven::FitterFactory::basisFunctions
protected

Container for GridTypes specifically for the basis function hyperparameter.

Referenced by sgpp::datadriven::LeastSquaresRegressionFitterFactory::buildFitter(), sgpp::datadriven::DensityEstimationFitterFactory::buildFitter(), and printConfig().

◆ catOptions

std::vector<int> sgpp::datadriven::FitterFactory::catOptions
protected

numer of options for all categorical parameters

Referenced by getBOConfig().

◆ catpar

std::map<std::string, DiscreteParameter> sgpp::datadriven::FitterFactory::catpar
protected

◆ conpar

std::map<std::string, ContinuousParameter> sgpp::datadriven::FitterFactory::conpar
protected

◆ discOptions

std::vector<int> sgpp::datadriven::FitterFactory::discOptions
protected

number of options for all discrete parameters

Referenced by getBOConfig().

◆ dispar

std::map<std::string, DiscreteParameter> sgpp::datadriven::FitterFactory::dispar
protected

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