Belle II Software development
|
Dataset needed during the training of a regression method. More...
#include <Regression.h>
Public Member Functions | |
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 cut value. | |
unsigned int | getNumberOfFeatures () const override |
Return the number of features from the real dataset. | |
unsigned int | getNumberOfEvents () const override |
Return the number of events from the real dataset. | |
unsigned int | getNumberOfSpectators () const override |
Return the number of spectators from the real dataset. | |
void | loadEvent (unsigned int iEvent) override |
Load an event. Sets all internal variables and sets the isSignal variable dependent on the cut value. | |
std::vector< float > | getFeature (unsigned int iFeature) override |
Return a specific feature from the real dataset. | |
std::vector< float > | getSpectator (unsigned int iSpectator) override |
Return a specific spectator from the real dataset. | |
std::vector< float > | getWeights () override |
Return the weights from the real dataset. | |
std::vector< float > | getTargets () override |
Return the targets from the real dataset. | |
virtual float | getSignalFraction () |
Returns the signal fraction of the whole sample. | |
virtual unsigned int | getFeatureIndex (const std::string &feature) |
Return index of feature with the given name. | |
virtual unsigned int | getSpectatorIndex (const std::string &spectator) |
Return index of spectator with the given name. | |
virtual std::vector< bool > | getSignals () |
Returns all is Signals. | |
Public Attributes | |
GeneralOptions | m_general_options |
GeneralOptions passed to this dataset. | |
std::vector< float > | m_input |
Contains all feature values of the currently loaded event. | |
std::vector< float > | m_spectators |
Contains all spectators values of the currently loaded event. | |
float | m_weight |
Contains the weight of the currently loaded event. | |
float | m_target |
Contains the target value of the currently loaded event. | |
bool | m_isSignal |
Defines if the currently loaded event is signal or background. | |
Private Attributes | |
double | m_cutValue |
The cut value. | |
Dataset * | m_childDataSet |
The real data set (our child) | |
Dataset needed during the training of a regression method.
It basically wraps another dataset it receives as pointer and every call to this dataset is forwarded to the other dataset.
The only difference is, that the isSignal variable is set dependent on the cut value given in the constructor to
isSignal = target >= cutValue
to generate a binary classification out of a regression task.
Definition at line 77 of file Regression.h.
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 cut value.
Definition at line 16 of file Regression.cc.
|
overridevirtual |
Return a specific feature from the real dataset.
Reimplemented from Dataset.
Definition at line 46 of file Regression.cc.
|
virtualinherited |
Return index of feature with the given name.
feature | name of the feature |
Definition at line 50 of file Dataset.cc.
|
overridevirtual |
Return the number of events from the real dataset.
Implements Dataset.
Definition at line 36 of file Regression.cc.
|
overridevirtual |
Return the number of features from the real dataset.
Implements Dataset.
Definition at line 31 of file Regression.cc.
|
overridevirtual |
Return the number of spectators from the real dataset.
Implements Dataset.
Definition at line 41 of file Regression.cc.
|
virtualinherited |
Returns the signal fraction of the whole sample.
Reimplemented in SPlotDataset.
Definition at line 35 of file Dataset.cc.
|
virtualinherited |
Returns all is Signals.
Reimplemented in ReweightingDataset.
Definition at line 122 of file Dataset.cc.
|
overridevirtual |
Return a specific spectator from the real dataset.
Reimplemented from Dataset.
Definition at line 51 of file Regression.cc.
|
virtualinherited |
Return index of spectator with the given name.
spectator | name of the spectator |
Definition at line 62 of file Dataset.cc.
|
overridevirtual |
Return the targets from the real dataset.
Reimplemented from Dataset.
Definition at line 61 of file Regression.cc.
|
overridevirtual |
Return the weights from the real dataset.
Reimplemented from Dataset.
Definition at line 56 of file Regression.cc.
|
overridevirtual |
Load an event. Sets all internal variables and sets the isSignal variable dependent on the cut value.
Implements Dataset.
Definition at line 21 of file Regression.cc.
|
private |
The real data set (our child)
Definition at line 111 of file Regression.h.
|
private |
The cut value.
Definition at line 108 of file Regression.h.
|
inherited |
GeneralOptions passed to this dataset.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |