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

Container class to store a conrete hyperparameter configuration for interaction with Bayesian Optimization. More...

#include <BOConfig.hpp>

Public Member Functions

 BOConfig ()=default
 Default Constructor.
 
 BOConfig (std::vector< int > *discOptions, std::vector< int > *catOptions, size_t nCont)
 Constructor for making a prototype based on the number of hyperparameters.
 
void calcDiscDistance (BOConfig &other, base::DataVector &scales)
 calculation of discrete part of the distance between two BOConfigs/sample points
 
int getCat (size_t idx)
 Get the value of a specific categorical parameter.
 
double getCont (size_t idx)
 Get the value of a specific continuous parameter.
 
size_t getContSize ()
 Get number of continuous parameters.
 
int getDisc (size_t idx)
 Get the value of a specific discrete parameter.
 
size_t getNPar () const
 Get number total number of parameters.
 
double getScaledDistance (BOConfig &other, const base::DataVector &scales)
 Compute complete distance to another BOConfig/sample point.
 
double getScore ()
 Get score measured on this sample.
 
double getTotalDistance (const base::DataVector &input, base::DataVector &scales)
 finish previous distance calculation by adding the continuous part
 
bool nextDisc ()
 Iterator over discrete parameter options.
 
void randomize (std::mt19937 &generator)
 Generate a random config.
 
void setCont (const base::DataVector &input)
 Set the continuous parameters according to input.
 
void setScore (double input)
 Set score measured on this sample.
 

Detailed Description

Container class to store a conrete hyperparameter configuration for interaction with Bayesian Optimization.

Constructor & Destructor Documentation

◆ BOConfig() [1/2]

sgpp::datadriven::BOConfig::BOConfig ( )
default

Default Constructor.

◆ BOConfig() [2/2]

sgpp::datadriven::BOConfig::BOConfig ( std::vector< int > *  discOptions,
std::vector< int > *  catOptions,
size_t  nCont 
)

Constructor for making a prototype based on the number of hyperparameters.

Parameters
discOptionsnumber of options for each discrete parameter
catOptionsnumber of options for each categorical parameter
nContnumber of continuous parameters

Member Function Documentation

◆ calcDiscDistance()

void sgpp::datadriven::BOConfig::calcDiscDistance ( BOConfig other,
base::DataVector scales 
)

calculation of discrete part of the distance between two BOConfigs/sample points

Parameters
othersample point to calculate distance to
scalesscaling of hyperparameters in relation to each other

Referenced by sgpp::datadriven::BayesianOptimization::main().

◆ getCat()

int sgpp::datadriven::BOConfig::getCat ( size_t  idx)

Get the value of a specific categorical parameter.

Parameters
idxparameter position
Returns
parameter value

Referenced by sgpp::datadriven::FitterFactory::setBO().

◆ getCont()

double sgpp::datadriven::BOConfig::getCont ( size_t  idx)

Get the value of a specific continuous parameter.

Parameters
idxparameter position
Returns
parameter value

Referenced by sgpp::datadriven::FitterFactory::setBO().

◆ getContSize()

size_t sgpp::datadriven::BOConfig::getContSize ( )

Get number of continuous parameters.

Returns
number of continuous parameters

Referenced by sgpp::datadriven::BayesianOptimization::main().

◆ getDisc()

int sgpp::datadriven::BOConfig::getDisc ( size_t  idx)

Get the value of a specific discrete parameter.

Parameters
idxparameter position
Returns
parameter value

Referenced by sgpp::datadriven::FitterFactory::setBO().

◆ getNPar()

size_t sgpp::datadriven::BOConfig::getNPar ( ) const

Get number total number of parameters.

Returns
number of continuous parameters

◆ getScaledDistance()

double sgpp::datadriven::BOConfig::getScaledDistance ( BOConfig other,
const base::DataVector scales 
)

Compute complete distance to another BOConfig/sample point.

Parameters
othersample point to calculate distance to
scalesscaling of hyperparameters in relation to each other
Returns
distance measure

◆ getScore()

double sgpp::datadriven::BOConfig::getScore ( )

Get score measured on this sample.

Returns
score

Referenced by sgpp::datadriven::BayesianOptimization::updateGP().

◆ getTotalDistance()

double sgpp::datadriven::BOConfig::getTotalDistance ( const base::DataVector input,
base::DataVector scales 
)

finish previous distance calculation by adding the continuous part

Parameters
inputcontinuous part of the other (new) sample point
scalesscaling of hyperparameters in relation to each other
Returns
complete distance measure

◆ nextDisc()

bool sgpp::datadriven::BOConfig::nextDisc ( )

Iterator over discrete parameter options.

Returns
stopping criterion

Referenced by sgpp::datadriven::BayesianOptimization::main().

◆ randomize()

void sgpp::datadriven::BOConfig::randomize ( std::mt19937 &  generator)

Generate a random config.

Parameters
generatorfor seeded rng

◆ setCont()

void sgpp::datadriven::BOConfig::setCont ( const base::DataVector input)

Set the continuous parameters according to input.

Parameters
inputDataVector holding continuous parameters

Referenced by sgpp::datadriven::BayesianOptimization::main().

◆ setScore()

void sgpp::datadriven::BOConfig::setScore ( double  input)

Set score measured on this sample.

Parameters
inputscore

Referenced by sgpp::datadriven::BoHyperparameterOptimizer::run().


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