Options for the Python MVA method.
More...
#include <Python.h>
|
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.
|
|
|
std::string | m_framework = "sklearn" |
| framework to use e.g.
|
|
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)
|
|
Options for the Python MVA method.
Definition at line 52 of file Python.h.
◆ getDescription()
po::options_description getDescription |
( |
| ) |
|
|
overridevirtual |
Returns a program options description for all available options.
Implements Options.
Definition at line 63 of file Python.cc.
64 {
65 po::options_description description("Python options");
66 description.add_options()
68 "Framework which should be used. Currently supported are sklearn, tensorflow and theano")
69 (
"steering_file", po::value<std::string>(&
m_steering_file),
"Steering file which describes")
70 (
"mini_batch_size", po::value<unsigned int>(&
m_mini_batch_size),
"Size of the mini batch given to partial_fit function")
71 (
"nIterations", po::value<unsigned int>(&
m_nIterations),
"Number of iterations")
72 (
"normalize", po::value<bool>(&
m_normalize),
"Normalize input data (shift mean to 0 and std to 1)")
74 "Training fraction used to split up dataset in training and validation sample.")
75 (
"config", po::value<std::string>(&
m_config),
"Json encoded python object passed to begin_fit function");
76 return description;
77 }
unsigned int m_nIterations
Number of iterations through the whole data.
std::string m_steering_file
steering file provided by the user to override the functions in the framework
std::string m_framework
framework to use e.g.
std::string m_config
Config string in json, which is passed to the get model function.
bool m_normalize
Normalize the inputs (shift mean to zero and std to 1)
double m_training_fraction
Fraction of data passed as training data, rest is passed as test data.
unsigned int m_mini_batch_size
Mini batch size, 0 passes the whole data in one call.
◆ getMethod()
virtual std::string getMethod |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ load()
void load |
( |
const boost::property_tree::ptree & |
pt | ) |
|
|
overridevirtual |
Load mechanism to load Options from a xml tree.
- Parameters
-
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");
41 m_config = pt.get<std::string>(
"Python_config");
43 if (version == 2) {
45 } else {
47 }
48
49 }
◆ save()
void save |
( |
boost::property_tree::ptree & |
pt | ) |
const |
|
overridevirtual |
Save mechanism to store Options in a xml tree.
- Parameters
-
Implements Options.
Definition at line 51 of file Python.cc.
52 {
53 pt.put("Python_version", 2);
61 }
◆ m_config
std::string m_config = "null" |
Config string in json, which is passed to the get model function.
Definition at line 79 of file Python.h.
◆ m_framework
std::string m_framework = "sklearn" |
framework to use e.g.
sklearn, xgboost, theano, tensorflow, ...
Definition at line 77 of file Python.h.
◆ m_mini_batch_size
unsigned int m_mini_batch_size = 0 |
Mini batch size, 0 passes the whole data in one call.
Definition at line 80 of file Python.h.
◆ m_nIterations
unsigned int m_nIterations = 1 |
Number of iterations through the whole data.
Definition at line 81 of file Python.h.
◆ m_normalize
Normalize the inputs (shift mean to zero and std to 1)
Definition at line 83 of file Python.h.
◆ m_steering_file
std::string m_steering_file = "" |
steering file provided by the user to override the functions in the framework
Definition at line 78 of file Python.h.
◆ m_training_fraction
double m_training_fraction = 1.0 |
Fraction of data passed as training data, rest is passed as test data.
Definition at line 82 of file Python.h.
The documentation for this class was generated from the following files: