Belle II Software development
|
Wraps another Dataset and provides a view to a subset of its features and events. More...
#include <Dataset.h>
Public Member Functions | |
SubDataset (const GeneralOptions &general_options, const std::vector< bool > &events, Dataset &dataset) | |
Constructs a new SubDataset holding a reference to the wrapped Dataset. | |
virtual unsigned int | getNumberOfFeatures () const override |
Returns the number of features in this dataset, so the size of the given subset of the variables. | |
virtual unsigned int | getNumberOfSpectators () const override |
Returns the number of spectators in this dataset, so the size of the given subset of the spectators. | |
virtual unsigned int | getNumberOfEvents () const override |
Returns the number of events in the wrapped dataset. | |
virtual void | loadEvent (unsigned int iEvent) override |
Load the event number iEvent from the wrapped dataset. | |
virtual std::vector< float > | getFeature (unsigned int iFeature) override |
Returns all values of one feature in a std::vector<float> of the wrapped dataset. | |
virtual std::vector< float > | getSpectator (unsigned int iSpectator) override |
Returns all values of one spectator in a std::vector<float> of the wrapped 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< float > | getWeights () |
Returns all weights. | |
virtual std::vector< float > | getTargets () |
Returns all targets. | |
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 | |
bool | m_use_event_indices = false |
Use only a subset of the wrapped dataset events. | |
std::vector< unsigned int > | m_feature_indices |
Mapping from the position of a feature in the given subset to its position in the wrapped dataset. | |
std::vector< unsigned int > | m_spectator_indices |
Mapping from the position of a spectator in the given subset to its position in the wrapped dataset. | |
std::vector< unsigned int > | m_event_indices |
Mapping from the position of a event in the given subset to its position in the wrapped dataset. | |
Dataset & | m_dataset |
Reference to the wrapped dataset. | |
Wraps another Dataset and provides a view to a subset of its features and events.
Used by the Combination method which can combine multiple methods with possibly different variables
SubDataset | ( | const GeneralOptions & | general_options, |
const std::vector< bool > & | events, | ||
Dataset & | dataset | ||
) |
Constructs a new SubDataset holding a reference to the wrapped Dataset.
general_options | which defines e.g. a subset of variables of the original dataset |
events | subset of events which are provided by this Dataset |
dataset | reference to the wrapped Dataset |
Definition at line 186 of file Dataset.cc.
|
overridevirtual |
Returns all values of one feature in a std::vector<float> of the wrapped dataset.
iFeature | the position of the feature to return in the given subset |
Reimplemented from Dataset.
Definition at line 245 of file Dataset.cc.
|
virtualinherited |
Return index of feature with the given name.
feature | name of the feature |
Definition at line 50 of file Dataset.cc.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
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 |
Returns all values of one spectator in a std::vector<float> of the wrapped dataset.
iSpectator | the position of the spectator to return in the given subset |
Reimplemented from Dataset.
Definition at line 259 of file Dataset.cc.
|
virtualinherited |
Return index of spectator with the given name.
spectator | name of the spectator |
Definition at line 62 of file Dataset.cc.
|
virtualinherited |
Returns all targets.
Reimplemented in RegressionDataSet, and ReweightingDataset.
Definition at line 110 of file Dataset.cc.
|
virtualinherited |
Returns all weights.
Reimplemented in ROOTDataset, RegressionDataSet, and ReweightingDataset.
Definition at line 98 of file Dataset.cc.
|
overridevirtual |
Load the event number iEvent from the wrapped dataset.
iEvent | event number to load |
Implements Dataset.
Definition at line 225 of file Dataset.cc.
|
private |
|
private |
|
private |
|
inherited |
GeneralOptions passed to this dataset.
|
inherited |
|
inherited |
|
private |
|
inherited |
|
inherited |
|
private |
|
inherited |