Medial Code Documentation
|
A class which fetches the samples in bootstrap manner in lazy way. More...
#include <bootstrap.h>
Public Member Functions | |
Lazy_Iterator (const vector< int > *p_pids, const vector< float > *p_preds, const vector< float > *p_y, const vector< float > *p_w, float p_sample_ratio, int p_sample_per_pid, int max_loops, int seed, const vector< int > *p_preds_order=NULL) | |
The Ctor. | |
void | init (const vector< int > *p_pids, const vector< float > *p_preds, const vector< float > *p_y, const vector< float > *p_w, float p_sample_ratio, int p_sample_per_pid, int max_loops, int seed) |
bool | fetch_next (int thread, float &ret_y, float &ret_pred, float &weight) |
Inline function to fetch next pred,label couple in the bootstrap process. | |
bool | fetch_next (int thread, float &ret_y, const float *&ret_pred, float &weight, const int *&preds_order) |
bool | fetch_next_external (int thread, float &ret_y, float &ret_pred, float &weight) |
external function to fetch next pred,label couple in the bootstrap process for external implementitions | |
bool | fetch_next_external (int thread, float &ret_y, float &ret_pred, float &weight, const int *&preds_order) |
external function to fetch next pred,label couple in the bootstrap process for external implementitions | |
void | restart_iterator (int thread) |
to restart the iterator | |
void | set_static (const vector< float > *p_y, const vector< float > *p_preds, const vector< float > *p_w, const vector< int > *p_preds_order, int thread_num) |
set the bootstrap to retrieve those vectors p_y,p_preds with no randomizations | |
void | set_thread_sample_all (int thread) |
A class which fetches the samples in bootstrap manner in lazy way.
The object doesn't creates vectors for labels,scores in each bootstrap but fetches the samples in randomization without creating memory allocation
Lazy_Iterator::Lazy_Iterator | ( | const vector< int > * | p_pids, |
const vector< float > * | p_preds, | ||
const vector< float > * | p_y, | ||
const vector< float > * | p_w, | ||
float | p_sample_ratio, | ||
int | p_sample_per_pid, | ||
int | max_loops, | ||
int | seed, | ||
const vector< int > * | p_preds_order = NULL |
||
) |
The Ctor.
p_pids | a reference to the ids vector |
p_preds | a reference to the predicitons vector |
p_y | a reference to the labels vector |
p_sample_ratio | a sample ratio parameter for the bootstrap (0-1] |
p_sample_per_pid | a sample count per patient |
max_loops | a maximal number of accessing the bootstrap (num of threads or the bootstrap loop count). |
seed | if 0 will use random device to select seed for randomization |
void Lazy_Iterator::set_static | ( | const vector< float > * | p_y, |
const vector< float > * | p_preds, | ||
const vector< float > * | p_w, | ||
const vector< int > * | p_preds_order, | ||
int | thread_num | ||
) |
set the bootstrap to retrieve those vectors p_y,p_preds with no randomizations
p_y | a pointer to array labels |
p_preds | a pointer to array predictions |
thread_num | an access point to the bootstrap state - thread_numbeer or bootstrap loop count |