 |
Belle II Software
release-05-01-25
|
10 #include <mva/methods/Trivial.h>
12 #include <framework/logging/Logger.h>
23 int version = pt.get<
int>(
"Trivial_version");
25 B2ERROR(
"Unkown weightfile version " << std::to_string(version));
26 throw std::runtime_error(
"Unkown weightfile version " + std::to_string(version));
28 m_output = pt.get<
double>(
"Trivial_output");
33 pt.put(
"Trivial_version", 1);
39 po::options_description description(
"Trivial options");
40 description.add_options()
41 (
"output", po::value<double>(&
m_output),
"Outputs allows this given floating point number");
48 m_specific_options(specific_options) { }
67 std::vector<float> probabilities(test_data.getNumberOfEvents());
68 for (
unsigned int iEvent = 0; iEvent < test_data.getNumberOfEvents(); ++iEvent) {
69 test_data.loadEvent(iEvent);
TrivialTeacher(const GeneralOptions &general_options, const TrivialOptions &specific_options)
Constructs a new teacher using the GeneralOptions and specific options of this training.
Abstract base class of all Datasets given to the MVA interface The current event can always be access...
virtual void save(boost::property_tree::ptree &pt) const override
Save mechanism to store Options in a xml tree.
void addSignalFraction(float signal_fraction)
Saves the signal fraction in the xml tree.
void getOptions(Options &options) const
Fills an Option object from the xml tree.
The Weightfile class serializes all information about a training into an xml tree.
virtual void load(Weightfile &weightfile) override
Load the expert from a Weightfile.
TrivialOptions m_specific_options
Method specific options.
virtual po::options_description getDescription() override
Returns a program options description for all available options.
GeneralOptions m_general_options
GeneralOptions containing all shared options.
Abstract base class for different kinds of events.
Abstract base class of all Teachers Each MVA library has its own implementation of this class,...
void addOptions(const Options &options)
Add an Option object to the xml tree.
virtual std::vector< float > apply(Dataset &test_data) const override
Apply this expert onto a dataset.
Options for the Trivial MVA method.
virtual Weightfile train(Dataset &training_data) const override
Train a mva method using the given dataset returning a Weightfile.
General options which are shared by all MVA trainings.
double m_output
Output of the trivial method.
virtual void load(const boost::property_tree::ptree &pt) override
Load mechanism to load Options from a xml tree.
TrivialOptions m_specific_options
Method specific options.