Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
Mem_Iterator Class Reference

A class which fetches the samples in bootstrap manner in memort way. More...

#include <bootstrap.h>

Public Member Functions

 Mem_Iterator (const vector< int > &pids, const vector< int > &cohort_indexes, float p_sample_ratio, int p_sample_per_pid, int seed)
 The Ctor.
 
void fetch_selection (vector< int > &indexes) const
 Inline function to fetch indexes.
 
void fetch_selection_external (vector< int > &indexes) const
 external function to fetch indexes
 
void fetch_selection (mt19937 &rd_gen, vector< int > &indexes) const
 Inline function to fetch indexes - for multi thread - provide random generator.
 
void fetch_selection_external (mt19937 &rd_gen, vector< int > &indexes) const
 external function to fetch indexes - for multi thread - provide random generator
 

Data Fields

float sample_ratio
 the sample ratio of the patients out of all patients in each bootstrap
 
int sample_per_pid
 how many samples to take for each patients. 0 - means no sampling take all sample for patient
 

Detailed Description

A class which fetches the samples in bootstrap manner in memort way.


The object selects indexes in each bootstrap fetches the samples in randomization by index vector in the future - choose dynamically the faster Iterator to use Lazy_Iterator or Mem_Iterator

Constructor & Destructor Documentation

◆ Mem_Iterator()

Mem_Iterator::Mem_Iterator ( const vector< int > &  pids,
const vector< int > &  cohort_indexes,
float  p_sample_ratio,
int  p_sample_per_pid,
int  seed 
)

The Ctor.

Parameters
pidsa reference to pids vector - without selection
cohort_indexesa reference to selected indexes from cohort filter to bootstrap indexes from
p_sample_ratioa sample ratio parameter for the bootstrap (0-1]
p_sample_per_pida sample count per patient (num of threads or the bootstrap loop count).
seedif 0 will use random device to select seed for randomization

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