Belle II Software prerelease-10-00-00a
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{
23 m_childDataSet->loadEvent(iEvent);
24 m_input = m_childDataSet->m_input;
25 m_spectators = m_childDataSet->m_spectators;
27 m_target = m_childDataSet->m_target;
28 m_weight = m_childDataSet->m_weight;
29}
30
32{
33 return m_childDataSet->getNumberOfFeatures();
34}
35
37{
38 return m_childDataSet->getNumberOfEvents();
39}
40
42{
43 return m_childDataSet->getNumberOfSpectators();
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}
std::vector< float > m_spectators
Contains all spectators values of the currently loaded event.
Definition Dataset.h:124
std::vector< float > m_input
Contains all feature values of the currently loaded event.
Definition Dataset.h:123
Dataset(const GeneralOptions &general_options)
Constructs a new dataset given the general options.
Definition Dataset.cc:26
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.