Belle II Software development
TMVAOptionsRegression Class Reference

Options for the TMVA Regression MVA method. More...

#include <TMVA.h>

Inheritance diagram for TMVAOptionsRegression:
TMVAOptions SpecificOptions Options

Public Member Functions

 TMVAOptionsRegression ()
 Constructor Adds REgression as AnalysisType to the factoryOptions.
 
virtual std::string getMethod () const override
 Return method name.
 
virtual void load (const boost::property_tree::ptree &pt) override
 Load mechanism to load Options from a xml tree.
 
virtual void save (boost::property_tree::ptree &pt) const override
 Save mechanism to store Options in a xml tree.
 
virtual po::options_description getDescription () override
 Returns a program options description for all available options.
 

Public Attributes

std::string m_method = "BDT"
 tmva method name
 
std::string m_type = "BDT"
 tmva method type
 
std::string m_config
 TMVA config string for the chosen method.
 
std::string m_factoryOption = "!V:!Silent:Color:DrawProgressBar"
 Factory options passed to tmva factory.
 
std::string m_prepareOption = "SplitMode=random:!V"
 Prepare options passed to prepareTrainingAndTestTree method.
 
std::string m_workingDirectory = ""
 Working directory of TMVA, if empty a temporary directory is used.
 
std::string m_prefix = "TMVA"
 Prefix used for all files generated by TMVA.
 

Detailed Description

Options for the TMVA Regression MVA method.

Definition at line 166 of file TMVA.h.

Constructor & Destructor Documentation

◆ TMVAOptionsRegression()

Constructor Adds REgression as AnalysisType to the factoryOptions.

Definition at line 173 of file TMVA.h.

174 {
175 m_factoryOption += ":AnalysisType=Regression";
176 }
std::string m_factoryOption
Factory options passed to tmva factory.
Definition: TMVA.h:71

Member Function Documentation

◆ getDescription()

po::options_description getDescription ( )
overridevirtualinherited

Returns a program options description for all available options.

Implements Options.

Reimplemented in TMVAOptionsClassification, and TMVAOptionsMulticlass.

Definition at line 55 of file TMVA.cc.

56 {
57 po::options_description description("TMVA options");
58 description.add_options()
59 ("tmva_method", po::value<std::string>(&m_method), "TMVA Method Name")
60 ("tmva_type", po::value<std::string>(&m_type), "TMVA Method Type (e.g. Plugin, BDT, ...)")
61 ("tmva_config", po::value<std::string>(&m_config), "TMVA Configuration string for the method")
62 ("tmva_working_directory", po::value<std::string>(&m_workingDirectory), "TMVA working directory which stores e.g. TMVA.root")
63 ("tmva_factory", po::value<std::string>(&m_factoryOption), "TMVA Factory options passed to TMVAFactory constructor")
64 ("tmva_prepare", po::value<std::string>(&m_prepareOption),
65 "TMVA Preprare options passed to prepareTrainingAndTestTree function");
66 return description;
67 }
std::string m_prepareOption
Prepare options passed to prepareTrainingAndTestTree method.
Definition: TMVA.h:72
std::string m_config
TMVA config string for the chosen method.
Definition: TMVA.h:66
std::string m_method
tmva method name
Definition: TMVA.h:60
std::string m_type
tmva method type
Definition: TMVA.h:61
std::string m_workingDirectory
Working directory of TMVA, if empty a temporary directory is used.
Definition: TMVA.h:73

◆ getMethod()

virtual std::string getMethod ( ) const
inlineoverridevirtual

Return method name.

Reimplemented from TMVAOptions.

Definition at line 181 of file TMVA.h.

181{ return "TMVARegression"; }

◆ load()

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

Load mechanism to load Options from a xml tree.

Parameters
ptxml tree

Implements Options.

Reimplemented in TMVAOptionsClassification, and TMVAOptionsMulticlass.

Definition at line 27 of file TMVA.cc.

28 {
29 int version = pt.get<int>("TMVA_version");
30 if (version != 1) {
31 B2ERROR("Unknown weightfile version " << std::to_string(version));
32 throw std::runtime_error("Unknown weightfile version " + std::to_string(version));
33 }
34 m_method = pt.get<std::string>("TMVA_method");
35 m_type = pt.get<std::string>("TMVA_type");
36 m_config = pt.get<std::string>("TMVA_config");
37 m_factoryOption = pt.get<std::string>("TMVA_factoryOption");
38 m_prepareOption = pt.get<std::string>("TMVA_prepareOption");
39 m_workingDirectory = pt.get<std::string>("TMVA_workingDirectory");
40 m_prefix = pt.get<std::string>("TMVA_prefix");
41 }
std::string m_prefix
Prefix used for all files generated by TMVA.
Definition: TMVA.h:74

◆ save()

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

Save mechanism to store Options in a xml tree.

Parameters
ptxml tree

Implements Options.

Reimplemented in TMVAOptionsClassification, and TMVAOptionsMulticlass.

Definition at line 43 of file TMVA.cc.

44 {
45 pt.put("TMVA_version", 1);
46 pt.put("TMVA_method", m_method);
47 pt.put("TMVA_type", m_type);
48 pt.put("TMVA_config", m_config);
49 pt.put("TMVA_factoryOption", m_factoryOption);
50 pt.put("TMVA_prepareOption", m_prepareOption);
51 pt.put("TMVA_workingDirectory", m_workingDirectory);
52 pt.put("TMVA_prefix", m_prefix);
53 }

Member Data Documentation

◆ m_config

std::string m_config
inherited
Initial value:
=
"!H:!V:CreateMVAPdfs:NTrees=400:BoostType=Grad:Shrinkage=0.1:UseBaggedBoost:BaggedSampleFraction=0.5:nCuts=1024:MaxDepth=3:IgnoreNegWeightsInTraining"

TMVA config string for the chosen method.

Definition at line 66 of file TMVA.h.

◆ m_factoryOption

std::string m_factoryOption = "!V:!Silent:Color:DrawProgressBar"
inherited

Factory options passed to tmva factory.

Definition at line 71 of file TMVA.h.

◆ m_method

std::string m_method = "BDT"
inherited

tmva method name

Definition at line 60 of file TMVA.h.

◆ m_prefix

std::string m_prefix = "TMVA"
inherited

Prefix used for all files generated by TMVA.

Definition at line 74 of file TMVA.h.

◆ m_prepareOption

std::string m_prepareOption = "SplitMode=random:!V"
inherited

Prepare options passed to prepareTrainingAndTestTree method.

Definition at line 72 of file TMVA.h.

◆ m_type

std::string m_type = "BDT"
inherited

tmva method type

Definition at line 61 of file TMVA.h.

◆ m_workingDirectory

std::string m_workingDirectory = ""
inherited

Working directory of TMVA, if empty a temporary directory is used.

Definition at line 73 of file TMVA.h.


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