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