Belle II Software development
Regression.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <mva/methods/Regression.h>
10
11#include <vector>
12
13using namespace Belle2;
14using namespace MVA;
15
16RegressionDataSet::RegressionDataSet(const GeneralOptions& general_options, Dataset* dataset, double cutValue) :
17 Dataset(general_options), m_cutValue(cutValue), m_childDataSet(dataset)
18{
19}
20
21void RegressionDataSet::loadEvent(unsigned int iEvent)
22{
29}
30
32{
34}
35
37{
39}
40
42{
44}
45
46std::vector<float> RegressionDataSet::getFeature(unsigned int iFeature)
47{
48 return m_childDataSet->getFeature(iFeature);
49}
50
51std::vector<float> RegressionDataSet::getSpectator(unsigned int iSpectator)
52{
53 return m_childDataSet->getSpectator(iSpectator);
54}
55
57{
58 return m_childDataSet->getWeights();
59}
60
62{
63 return m_childDataSet->getTargets();
64}
Abstract base class of all Datasets given to the MVA interface The current event can always be access...
Definition: Dataset.h:33
virtual unsigned int getNumberOfEvents() const =0
Returns the number of events in this dataset.
virtual unsigned int getNumberOfSpectators() const =0
Returns the number of spectators in this dataset.
virtual unsigned int getNumberOfFeatures() const =0
Returns the number of features in this dataset.
virtual std::vector< float > getSpectator(unsigned int iSpectator)
Returns all values of one spectator in a std::vector<float>
Definition: Dataset.cc:86
std::vector< float > m_spectators
Contains all spectators values of the currently loaded event.
Definition: Dataset.h:124
virtual std::vector< float > getTargets()
Returns all targets.
Definition: Dataset.cc:110
virtual void loadEvent(unsigned int iEvent)=0
Load the event number iEvent.
std::vector< float > m_input
Contains all feature values of the currently loaded event.
Definition: Dataset.h:123
virtual std::vector< float > getFeature(unsigned int iFeature)
Returns all values of one feature in a std::vector<float>
Definition: Dataset.cc:74
virtual std::vector< float > getWeights()
Returns all weights.
Definition: Dataset.cc:98
bool m_isSignal
Defines if the currently loaded event is signal or background.
Definition: Dataset.h:127
float m_weight
Contains the weight of the currently loaded event.
Definition: Dataset.h:125
float m_target
Contains the target value of the currently loaded event.
Definition: Dataset.h:126
General options which are shared by all MVA trainings.
Definition: Options.h:62
std::vector< float > getTargets() override
Return the targets from the real dataset.
Definition: Regression.cc:61
unsigned int getNumberOfEvents() const override
Return the number of events from the real dataset.
Definition: Regression.cc:36
std::vector< float > getSpectator(unsigned int iSpectator) override
Return a specific spectator from the real dataset.
Definition: Regression.cc:51
unsigned int getNumberOfSpectators() const override
Return the number of spectators from the real dataset.
Definition: Regression.cc:41
unsigned int getNumberOfFeatures() const override
Return the number of features from the real dataset.
Definition: Regression.cc:31
std::vector< float > getFeature(unsigned int iFeature) override
Return a specific feature from the real dataset.
Definition: Regression.cc:46
std::vector< float > getWeights() override
Return the weights from the real dataset.
Definition: Regression.cc:56
void loadEvent(unsigned int iEvent) override
Load an event. Sets all internal variables and sets the isSignal variable dependent on the cut value.
Definition: Regression.cc:21
Dataset * m_childDataSet
The real data set (our child)
Definition: Regression.h:111
double m_cutValue
The cut value.
Definition: Regression.h:108
RegressionDataSet(const GeneralOptions &general_options, Dataset *dataSet, double cutValue)
Create a new regression data set out of the general options, a pointer to the real dataset and the cu...
Definition: Regression.cc:16
Abstract base class for different kinds of events.