Belle II Software  release-05-01-25
Trivial.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Thomas Keck *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 #ifndef INCLUDE_GUARD_BELLE2_MVA_TRIVIAL_HEADER
13 #define INCLUDE_GUARD_BELLE2_MVA_TRIVIAL_HEADER
14 
15 #include <mva/interface/Options.h>
16 #include <mva/interface/Teacher.h>
17 #include <mva/interface/Expert.h>
18 
19 namespace Belle2 {
24  namespace MVA {
25 
31 
32  public:
37  virtual void load(const boost::property_tree::ptree& pt) override;
38 
43  virtual void save(boost::property_tree::ptree& pt) const override;
44 
48  virtual po::options_description getDescription() override;
49 
53  virtual std::string getMethod() const override { return "Trivial"; }
54 
55  double m_output = 0.5;
56  };
57 
62  class TrivialTeacher : public Teacher {
63 
64  public:
70  TrivialTeacher(const GeneralOptions& general_options, const TrivialOptions& specific_options);
71 
76  virtual Weightfile train(Dataset& training_data) const override;
77 
78  private:
80  };
81 
86  class TrivialExpert : public MVA::Expert {
87 
88  public:
93  virtual void load(Weightfile& weightfile) override;
94 
99  virtual std::vector<float> apply(Dataset& test_data) const override;
100 
101  private:
103  };
104 
105  }
107 }
108 #endif
Belle2::MVA::TrivialTeacher::TrivialTeacher
TrivialTeacher(const GeneralOptions &general_options, const TrivialOptions &specific_options)
Constructs a new teacher using the GeneralOptions and specific options of this training.
Definition: Trivial.cc:46
Belle2::MVA::Dataset
Abstract base class of all Datasets given to the MVA interface The current event can always be access...
Definition: Dataset.h:34
Belle2::MVA::TrivialOptions::save
virtual void save(boost::property_tree::ptree &pt) const override
Save mechanism to store Options in a xml tree.
Definition: Trivial.cc:31
Belle2::MVA::TrivialExpert
Expert for the Trivial MVA method.
Definition: Trivial.h:86
Belle2::MVA::TrivialOptions::getMethod
virtual std::string getMethod() const override
Return method name.
Definition: Trivial.h:53
Belle2::MVA::Weightfile
The Weightfile class serializes all information about a training into an xml tree.
Definition: Weightfile.h:40
Belle2::MVA::TrivialTeacher
Teacher for the Trivial MVA method.
Definition: Trivial.h:62
Belle2::MVA::TrivialExpert::load
virtual void load(Weightfile &weightfile) override
Load the expert from a Weightfile.
Definition: Trivial.cc:59
Belle2::MVA::SpecificOptions
Specific Options, all mehtod Options have to inherit from this class.
Definition: Options.h:99
Belle2::MVA::TrivialExpert::m_specific_options
TrivialOptions m_specific_options
Method specific options.
Definition: Trivial.h:102
Belle2::MVA::TrivialOptions::getDescription
virtual po::options_description getDescription() override
Returns a program options description for all available options.
Definition: Trivial.cc:37
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::MVA::Teacher
Abstract base class of all Teachers Each MVA library has its own implementation of this class,...
Definition: Teacher.h:31
Belle2::MVA::TrivialExpert::apply
virtual std::vector< float > apply(Dataset &test_data) const override
Apply this expert onto a dataset.
Definition: Trivial.cc:64
Belle2::MVA::TrivialOptions
Options for the Trivial MVA method.
Definition: Trivial.h:30
Belle2::MVA::Expert
Abstract base class of all Expert Each MVA library has its own implementation of this class,...
Definition: Expert.h:33
Belle2::MVA::TrivialTeacher::train
virtual Weightfile train(Dataset &training_data) const override
Train a mva method using the given dataset returning a Weightfile.
Definition: Trivial.cc:50
Belle2::MVA::GeneralOptions
General options which are shared by all MVA trainings.
Definition: Options.h:64
Belle2::MVA::TrivialOptions::m_output
double m_output
Output of the trivial method.
Definition: Trivial.h:55
Belle2::MVA::TrivialOptions::load
virtual void load(const boost::property_tree::ptree &pt) override
Load mechanism to load Options from a xml tree.
Definition: Trivial.cc:21
Belle2::MVA::TrivialTeacher::m_specific_options
TrivialOptions m_specific_options
Method specific options.
Definition: Trivial.h:79