Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::Experimental::Internal::RSampler Class Reference

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)
 
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< RFlat2DMatrixOperatorsfTensorOperators
 

#include <TMVA/BatchGenerator/RSampler.hxx>

Constructor & Destructor Documentation

◆ RSampler()

TMVA::Experimental::Internal::RSampler::RSampler ( std::vector< RFlat2DMatrix > & datasets,
const std::string & sampleType,
float sampleRatio,
bool replacement = false,
bool shuffle = true,
std::size_t setSeed = 0 )
inline

Definition at line 54 of file RSampler.hxx.

Member Function Documentation

◆ GetNumEntries()

std::size_t TMVA::Experimental::Internal::RSampler::GetNumEntries ( )
inline

Definition at line 246 of file RSampler.hxx.

◆ RandomOversampler()

void TMVA::Experimental::Internal::RSampler::RandomOversampler ( RFlat2DMatrix & ShuffledTensor)
inline

Oversample entries randomly from the minority dataset.

Parameters
[in]SampledTensorTensor with all the sampled entries

Definition at line 164 of file RSampler.hxx.

◆ RandomUndersampler()

void TMVA::Experimental::Internal::RSampler::RandomUndersampler ( RFlat2DMatrix & ShuffledTensor)
inline

Undersample entries randomly from the majority dataset.

Parameters
[in]SampledTensorTensor with all the sampled entries

Definition at line 135 of file RSampler.hxx.

◆ Sampler()

void TMVA::Experimental::Internal::RSampler::Sampler ( RFlat2DMatrix & SampledTensor)
inline

Collection of sampling types.

Parameters
[in]SampledTensorTensor with all the sampled entries

Definition at line 84 of file RSampler.hxx.

◆ SampleWithoutReplacement()

void TMVA::Experimental::Internal::RSampler::SampleWithoutReplacement ( std::size_t n_samples,
std::size_t max )
inline

Add indices without replacement to fSamples.

Parameters
[in]n_samplesNumber of indices to sample
[in]maxMax index of the sample distribution

Definition at line 219 of file RSampler.hxx.

◆ SampleWithReplacement()

void TMVA::Experimental::Internal::RSampler::SampleWithReplacement ( std::size_t n_samples,
std::size_t max )
inline

Add indices with replacement to fSamples.

Parameters
[in]n_samplesNumber of indices to sample
[in]maxMax index of the sample distribution

Definition at line 188 of file RSampler.hxx.

◆ SetupRandomOversampler()

void TMVA::Experimental::Internal::RSampler::SetupRandomOversampler ( )
inline

Calculate fNumEntries and major/minor variables for the random oversampler.

Definition at line 115 of file RSampler.hxx.

◆ SetupRandomUndersampler()

void TMVA::Experimental::Internal::RSampler::SetupRandomUndersampler ( )
inline

Calculate fNumEntries and major/minor variables for the random undersampler.

Definition at line 96 of file RSampler.hxx.

◆ SetupSampler()

void TMVA::Experimental::Internal::RSampler::SetupSampler ( )
inline

Calculate fNumEntries and major/minor variables.

Definition at line 71 of file RSampler.hxx.

Member Data Documentation

◆ fDatasets

std::vector<RFlat2DMatrix>& TMVA::Experimental::Internal::RSampler::fDatasets
private

Definition at line 35 of file RSampler.hxx.

◆ fMajor

std::size_t TMVA::Experimental::Internal::RSampler::fMajor
private

Definition at line 43 of file RSampler.hxx.

◆ fMinor

std::size_t TMVA::Experimental::Internal::RSampler::fMinor
private

Definition at line 44 of file RSampler.hxx.

◆ fNumEntries

std::size_t TMVA::Experimental::Internal::RSampler::fNumEntries
private

Definition at line 41 of file RSampler.hxx.

◆ fNumMajor

std::size_t TMVA::Experimental::Internal::RSampler::fNumMajor
private

Definition at line 45 of file RSampler.hxx.

◆ fNumMinor

std::size_t TMVA::Experimental::Internal::RSampler::fNumMinor
private

Definition at line 46 of file RSampler.hxx.

◆ fNumResampledMajor

std::size_t TMVA::Experimental::Internal::RSampler::fNumResampledMajor
private

Definition at line 47 of file RSampler.hxx.

◆ fNumResampledMinor

std::size_t TMVA::Experimental::Internal::RSampler::fNumResampledMinor
private

Definition at line 48 of file RSampler.hxx.

◆ fReplacement

bool TMVA::Experimental::Internal::RSampler::fReplacement
private

Definition at line 38 of file RSampler.hxx.

◆ fSampleRatio

float TMVA::Experimental::Internal::RSampler::fSampleRatio
private

Definition at line 37 of file RSampler.hxx.

◆ fSamples

std::vector<std::size_t> TMVA::Experimental::Internal::RSampler::fSamples
private

Definition at line 50 of file RSampler.hxx.

◆ fSampleType

std::string TMVA::Experimental::Internal::RSampler::fSampleType
private

Definition at line 36 of file RSampler.hxx.

◆ fSetSeed

std::size_t TMVA::Experimental::Internal::RSampler::fSetSeed
private

Definition at line 40 of file RSampler.hxx.

◆ fShuffle

bool TMVA::Experimental::Internal::RSampler::fShuffle
private

Definition at line 39 of file RSampler.hxx.

◆ fTensorOperators

std::unique_ptr<RFlat2DMatrixOperators> TMVA::Experimental::Internal::RSampler::fTensorOperators
private

Definition at line 52 of file RSampler.hxx.

Libraries for TMVA::Experimental::Internal::RSampler:

The documentation for this class was generated from the following file: