11#ifndef ROOT_INTERNAL_ML_RSAMPLER
12#define ROOT_INTERNAL_ML_RSAMPLER
54 RSampler(std::vector<RFlat2DMatrix> &datasets,
const std::string &sampleType,
float sampleRatio,
55 bool replacement =
false,
bool shuffle =
true, std::size_t setSeed = 0);
Collection of operations applied to one or multiple flat 2D matrices.
void SampleWithoutReplacement(std::size_t n_samples, std::size_t max)
Add indices without replacement to fSamples.
void SetupRandomUndersampler()
Calculate fNumEntries and major/minor variables for the random undersampler.
void RandomOversampler(RFlat2DMatrix &ShuffledTensor)
Oversample entries randomly from the minority dataset.
void SampleWithReplacement(std::size_t n_samples, std::size_t max)
Add indices with replacement to fSamples.
void SetupRandomOversampler()
Calculate fNumEntries and major/minor variables for the random oversampler.
void SetupSampler()
Calculate fNumEntries and major/minor variables.
std::vector< std::size_t > fSamples
std::size_t GetNumEntries()
std::unique_ptr< RFlat2DMatrixOperators > fTensorOperators
RSampler(std::vector< RFlat2DMatrix > &datasets, const std::string &sampleType, float sampleRatio, bool replacement=false, bool shuffle=true, std::size_t setSeed=0)
void RandomUndersampler(RFlat2DMatrix &ShuffledTensor)
Undersample entries randomly from the majority dataset.
std::size_t fNumResampledMajor
std::vector< RFlat2DMatrix > & fDatasets
void Sampler(RFlat2DMatrix &SampledTensor)
Collection of sampling types.
std::size_t fNumResampledMinor
Wrapper around ROOT::RVec<float> representing a 2D matrix.