Belle II Software development
TMVAOptionsMulticlass Class Reference

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

#include <TMVA.h>

Inheritance diagram for TMVAOptionsMulticlass:
TMVAOptions SpecificOptions Options

Public Member Functions

 TMVAOptionsMulticlass ()
 Constructor Adds Multiclass as AnalysisType to the factoryOptions.
 
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.
 
virtual std::string getMethod () const override
 Return method name.
 

Public Attributes

std::vector< std::string > m_classes
 Class name identifiers.
 
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 Multiclass MVA method.

Definition at line 122 of file TMVA.h.

Constructor & Destructor Documentation

◆ TMVAOptionsMulticlass()

Constructor Adds Multiclass as AnalysisType to the factoryOptions.

Definition at line 129 of file TMVA.h.

130 {
131 m_factoryOption += ":AnalysisType=Multiclass";
132 }
std::string m_factoryOption
Factory options passed to tmva factory.
Definition: TMVA.h:71

Member Function Documentation

◆ getDescription()

po::options_description getDescription ( )
overridevirtual

Returns a program options description for all available options.

Reimplemented from TMVAOptions.

Definition at line 110 of file TMVA.cc.

111 {
112 po::options_description description = TMVAOptions::getDescription();
113 description.add_options()
114 ("tmva_classes", po::value<std::vector<std::string>>(&m_classes)->required()->multitoken(),
115 "class name identifiers for multi-class mode");
116 return description;
117 }
std::vector< std::string > m_classes
Class name identifiers.
Definition: TMVA.h:158
virtual po::options_description getDescription() override
Returns a program options description for all available options.
Definition: TMVA.cc:55

◆ getMethod()

virtual std::string getMethod ( ) const
inlineoverridevirtual

Return method name.

Reimplemented from TMVAOptions.

Definition at line 154 of file TMVA.h.

154{ return "TMVAMulticlass"; }

◆ load()

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

Load mechanism to load Options from a xml tree.

Parameters
ptxml tree

Reimplemented from TMVAOptions.

Definition at line 89 of file TMVA.cc.

90 {
92
93 unsigned int numberOfClasses = pt.get<unsigned int>("TMVA_number_classes", 1);
94 m_classes.resize(numberOfClasses);
95 for (unsigned int i = 0; i < numberOfClasses; ++i) {
96 m_classes[i] = pt.get<std::string>(std::string("TMVA_classes") + std::to_string(i));
97 }
98 }
virtual void load(const boost::property_tree::ptree &pt) override
Load mechanism to load Options from a xml tree.
Definition: TMVA.cc:27

◆ save()

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

Save mechanism to store Options in a xml tree.

Parameters
ptxml tree

Reimplemented from TMVAOptions.

Definition at line 100 of file TMVA.cc.

101 {
103
104 pt.put("TMVA_number_classes", m_classes.size());
105 for (unsigned int i = 0; i < m_classes.size(); ++i) {
106 pt.put(std::string("TMVA_classes") + std::to_string(i), m_classes[i]);
107 }
108 }
virtual void save(boost::property_tree::ptree &pt) const override
Save mechanism to store Options in a xml tree.
Definition: TMVA.cc:43

Member Data Documentation

◆ m_classes

std::vector<std::string> m_classes

Class name identifiers.

Definition at line 158 of file TMVA.h.

◆ 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 files: