Belle II Software  release-08-01-10
PythonOptions Class Reference

Options for the Python MVA method. More...

#include <Python.h>

Inheritance diagram for PythonOptions:
Collaboration diagram for PythonOptions:

Public Member Functions

virtual void load (const boost::property_tree::ptree &pt) override
 Load mechanism to load Options from a xml tree. More...
 
virtual void save (boost::property_tree::ptree &pt) const override
 Save mechanism to store Options in a xml tree. More...
 
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::string m_framework = "sklearn"
 framework to use e.g. More...
 
std::string m_steering_file = ""
 steering file provided by the user to override the functions in the framework
 
std::string m_config = "null"
 Config string in json, which is passed to the get model function.
 
unsigned int m_mini_batch_size = 0
 Mini batch size, 0 passes the whole data in one call.
 
unsigned int m_nIterations = 1
 Number of iterations through the whole data.
 
double m_training_fraction = 1.0
 Fraction of data passed as training data, rest is passed as test data.
 
bool m_normalize = false
 Normalize the inputs (shift mean to zero and std to 1)
 

Detailed Description

Options for the Python MVA method.

Definition at line 52 of file Python.h.

Member Function Documentation

◆ load()

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

Load mechanism to load Options from a xml tree.

Parameters
ptxml tree

Implements Options.

Definition at line 30 of file Python.cc.

31  {
32  int version = pt.get<int>("Python_version");
33  if (version < 1 or version > 2) {
34  B2ERROR("Unknown weightfile version " << std::to_string(version));
35  throw std::runtime_error("Unknown weightfile version " + std::to_string(version));
36  }
37  m_framework = pt.get<std::string>("Python_framework");
38  m_steering_file = pt.get<std::string>("Python_steering_file");
39  m_mini_batch_size = pt.get<unsigned int>("Python_mini_batch_size");
40  m_nIterations = pt.get<unsigned int>("Python_n_iterations");
41  m_config = pt.get<std::string>("Python_config");
42  m_training_fraction = pt.get<double>("Python_training_fraction");
43  if (version == 2) {
44  m_normalize = pt.get<bool>("Python_normalize");
45  } else {
46  m_normalize = false;
47  }
48 
49  }
unsigned int m_nIterations
Number of iterations through the whole data.
Definition: Python.h:81
std::string m_steering_file
steering file provided by the user to override the functions in the framework
Definition: Python.h:78
std::string m_framework
framework to use e.g.
Definition: Python.h:77
std::string m_config
Config string in json, which is passed to the get model function.
Definition: Python.h:79
bool m_normalize
Normalize the inputs (shift mean to zero and std to 1)
Definition: Python.h:83
double m_training_fraction
Fraction of data passed as training data, rest is passed as test data.
Definition: Python.h:82
unsigned int m_mini_batch_size
Mini batch size, 0 passes the whole data in one call.
Definition: Python.h:80

◆ save()

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

Save mechanism to store Options in a xml tree.

Parameters
ptxml tree

Implements Options.

Definition at line 51 of file Python.cc.

Member Data Documentation

◆ m_framework

std::string m_framework = "sklearn"

framework to use e.g.

sklearn, xgboost, theano, tensorflow, ...

Definition at line 77 of file Python.h.


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