Belle II Software development
RegressionOptions< BaseClassifierOptions > Class Template Referenceabstract

Generic options of the Regression MVA methods hosting the number of bins (and the base classifier options). More...

#include <Regression.h>

Inheritance diagram for RegressionOptions< BaseClassifierOptions >:
SpecificOptions Options

Public Member Functions

void load (const boost::property_tree::ptree &pt) override
 Load the options from a boost property tree. Only loads the maximal bin number.
 
void save (boost::property_tree::ptree &pt) const override
 Save the options from a boost property tree. Only saves the maximal bin number.
 
po::options_description getDescription () override
 Get the descriptions for these options.
 
const BaseClassifierOptions & getBaseClassifierOptions () const
 Return options of the base classifier (const version)
 
BaseClassifierOptions & getBaseClassifierOptions ()
 Return options of the base classifier (non-const version)
 
unsigned int getMaximalBinNumber () const
 Return the number of bins to use.
 
void setMaximalBinNumber (unsigned int maximalBinNumber)
 Set the number of bins to use.
 
virtual std::string getMethod () const =0
 Returns method name, used in the interface to register the method.
 

Private Attributes

BaseClassifierOptions m_baseClassifierOptions
 Options of the base classifier.
 
unsigned int m_numberOfBins = 4
 How many bins to use.
 

Detailed Description

template<class BaseClassifierOptions>
class Belle2::MVA::RegressionOptions< BaseClassifierOptions >

Generic options of the Regression MVA methods hosting the number of bins (and the base classifier options).

You need to override this to add a getMethod() function. See the RegressionFastBDTOptions as an example.

Definition at line 34 of file Regression.h.

Member Function Documentation

◆ getBaseClassifierOptions() [1/2]

BaseClassifierOptions & getBaseClassifierOptions

Return options of the base classifier (non-const version)

Definition at line 221 of file Regression.h.

222{
224}
BaseClassifierOptions m_baseClassifierOptions
Options of the base classifier.
Definition: Regression.h:59

◆ getBaseClassifierOptions() [2/2]

const BaseClassifierOptions & getBaseClassifierOptions

Return options of the base classifier (const version)

Definition at line 215 of file Regression.h.

216{
218}

◆ getDescription()

po::options_description getDescription
overridevirtual

Get the descriptions for these options.

Implements Options.

Definition at line 233 of file Regression.h.

234{
235 auto description = getBaseClassifierOptions().getDescription();
236
237 description.add_options()
238 ("numberOfBins", po::value<unsigned int>(&m_numberOfBins),
239 "Number of bins to split the target variable into");
240
241 return description;
242}
const BaseClassifierOptions & getBaseClassifierOptions() const
Return options of the base classifier (const version)
Definition: Regression.h:215
unsigned int m_numberOfBins
How many bins to use.
Definition: Regression.h:61

◆ getMaximalBinNumber()

unsigned int getMaximalBinNumber

Return the number of bins to use.

Definition at line 203 of file Regression.h.

204{
205 return m_numberOfBins;
206}

◆ getMethod()

virtual std::string getMethod ( ) const
pure virtualinherited

◆ load()

void load ( const boost::property_tree::ptree &  pt)
overridevirtual

Load the options from a boost property tree. Only loads the maximal bin number.

Implements Options.

Definition at line 197 of file Regression.h.

198{
199 m_numberOfBins = pt.get<unsigned int>(getMethod() + "_numberOfBins");
200}
virtual std::string getMethod() const =0
Returns method name, used in the interface to register the method.

◆ save()

void save ( boost::property_tree::ptree &  pt) const
overridevirtual

Save the options from a boost property tree. Only saves the maximal bin number.

Implements Options.

Definition at line 227 of file Regression.h.

228{
229 pt.put(getMethod() + "_numberOfBins", m_numberOfBins);
230}

◆ setMaximalBinNumber()

void setMaximalBinNumber ( unsigned int  maximalBinNumber)

Set the number of bins to use.

Definition at line 209 of file Regression.h.

210{
211 m_numberOfBins = maximalBinNumber;
212}

Member Data Documentation

◆ m_baseClassifierOptions

BaseClassifierOptions m_baseClassifierOptions
private

Options of the base classifier.

Definition at line 59 of file Regression.h.

◆ m_numberOfBins

unsigned int m_numberOfBins = 4
private

How many bins to use.

Definition at line 61 of file Regression.h.


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