Implementation of different sampling strategies.
Definition at line 32 of file RSampler.hxx.
Public Member Functions | |
| RSampler (std::vector< RFlat2DMatrix > &datasets, const std::string &sampleType, float sampleRatio, bool replacement=false, bool shuffle=true, std::size_t setSeed=0) | |
| ~RSampler () | |
| std::size_t | GetNumEntries () |
| void | RandomOversampler (RFlat2DMatrix &ShuffledTensor) |
| Oversample entries randomly from the minority dataset. | |
| void | RandomUndersampler (RFlat2DMatrix &ShuffledTensor) |
| Undersample entries randomly from the majority dataset. | |
| void | Sampler (RFlat2DMatrix &SampledTensor) |
| Collection of sampling types. | |
| void | SampleWithoutReplacement (std::size_t n_samples, std::size_t max) |
| Add indices without replacement to fSamples. | |
| 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 | SetupRandomUndersampler () |
| Calculate fNumEntries and major/minor variables for the random undersampler. | |
| void | SetupSampler () |
| Calculate fNumEntries and major/minor variables. | |
Private Attributes | |
| std::vector< RFlat2DMatrix > & | fDatasets |
| std::size_t | fMajor |
| std::size_t | fMinor |
| std::size_t | fNumEntries |
| std::size_t | fNumMajor |
| std::size_t | fNumMinor |
| std::size_t | fNumResampledMajor |
| std::size_t | fNumResampledMinor |
| bool | fReplacement |
| float | fSampleRatio |
| std::vector< std::size_t > | fSamples |
| std::string | fSampleType |
| std::size_t | fSetSeed |
| bool | fShuffle |
| std::unique_ptr< RFlat2DMatrixOperators > | fTensorOperators |
| ROOT::Experimental::Internal::ML::RSampler::RSampler | ( | std::vector< RFlat2DMatrix > & | datasets, |
| const std::string & | sampleType, | ||
| float | sampleRatio, | ||
| bool | replacement = false, | ||
| bool | shuffle = true, | ||
| std::size_t | setSeed = 0 ) |
Definition at line 14 of file RSampler.cxx.
|
default |
|
inline |
Definition at line 75 of file RSampler.hxx.
| void ROOT::Experimental::Internal::ML::RSampler::RandomOversampler | ( | RFlat2DMatrix & | ShuffledTensor | ) |
Oversample entries randomly from the minority dataset.
| [in] | SampledTensor | Tensor with all the sampled entries |
Definition at line 128 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::RandomUndersampler | ( | RFlat2DMatrix & | ShuffledTensor | ) |
Undersample entries randomly from the majority dataset.
| [in] | SampledTensor | Tensor with all the sampled entries |
Definition at line 99 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::Sampler | ( | RFlat2DMatrix & | SampledTensor | ) |
Collection of sampling types.
| [in] | SampledTensor | Tensor with all the sampled entries |
Definition at line 43 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::SampleWithoutReplacement | ( | std::size_t | n_samples, |
| std::size_t | max ) |
Add indices without replacement to fSamples.
| [in] | n_samples | Number of indices to sample |
| [in] | max | Max index of the sample distribution |
Definition at line 183 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::SampleWithReplacement | ( | std::size_t | n_samples, |
| std::size_t | max ) |
Add indices with replacement to fSamples.
| [in] | n_samples | Number of indices to sample |
| [in] | max | Max index of the sample distribution |
Definition at line 152 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::SetupRandomOversampler | ( | ) |
Calculate fNumEntries and major/minor variables for the random oversampler.
Definition at line 80 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::SetupRandomUndersampler | ( | ) |
Calculate fNumEntries and major/minor variables for the random undersampler.
Definition at line 54 of file RSampler.cxx.
| void ROOT::Experimental::Internal::ML::RSampler::SetupSampler | ( | ) |
Calculate fNumEntries and major/minor variables.
Definition at line 31 of file RSampler.cxx.
|
private |
Definition at line 34 of file RSampler.hxx.
|
private |
Definition at line 42 of file RSampler.hxx.
|
private |
Definition at line 43 of file RSampler.hxx.
|
private |
Definition at line 40 of file RSampler.hxx.
|
private |
Definition at line 44 of file RSampler.hxx.
|
private |
Definition at line 45 of file RSampler.hxx.
|
private |
Definition at line 46 of file RSampler.hxx.
|
private |
Definition at line 47 of file RSampler.hxx.
|
private |
Definition at line 37 of file RSampler.hxx.
|
private |
Definition at line 36 of file RSampler.hxx.
|
private |
Definition at line 49 of file RSampler.hxx.
|
private |
Definition at line 35 of file RSampler.hxx.
|
private |
Definition at line 39 of file RSampler.hxx.
|
private |
Definition at line 38 of file RSampler.hxx.
|
private |
Definition at line 51 of file RSampler.hxx.