openModeller
Version 1.5.0
|
#include <AlgorithmRun.hh>
Public Member Functions | |
AlgorithmRun (const AlgorithmPtr &algo) | |
~AlgorithmRun () | |
int | initialize (int id, int comm_samples, const SamplerPtr &train_sampler, const SamplerPtr &test_sampler) |
void | run () |
void | stop () |
void | createModel () |
bool | running () const |
int | getId () const |
float | getProgress () const |
double | getOmission () const |
double | getCommission () const |
double | getError (int type) const |
Scalar | getValue (const Sample &x) const |
int | calculateOmission () |
int | calculateCommission () |
AlgorithmPtr | getAlgorithm () |
AlgorithmRun () | |
AlgorithmRun (const AlgorithmPtr &alg) | |
virtual | ~AlgorithmRun () |
int | initialize (int id, int comm_samples, const SamplerPtr &train_sampler, const SamplerPtr &test_sampler, int nparam, AlgParameter *param, BSAlgorithmFactory *factory) |
int | run () |
int | iterate () |
int | finalize () |
int | done () const |
bool | running () const |
int | getId () const |
float | getProgress () const |
double | getOmission () const |
double | getCommission () const |
double | getError (int type) const |
Scalar | getValue (const Sample &x) const |
AlgorithmPtr | getAlgorithm () const |
int | calculateOmission () |
int | calculateCommission () |
Private Member Functions | |
AlgorithmRun (const AlgorithmRun &) | |
AlgorithmRun & | operator= (const AlgorithmRun &) |
AlgorithmRun (const AlgorithmRun &) | |
AlgorithmRun & | operator= (const AlgorithmRun &) |
Private Attributes | |
AlgorithmPtr | _alg |
Number of points used to calculate commission. More... | |
int | _id |
Algorithm used in this run. More... | |
bool | _running |
Identified for this particular garp run. More... | |
double | _omission |
Indicates whether the thread is running. More... | |
double | _commission |
Omission error for this run. More... | |
int | _commission_samples |
Commission error, approximated by area predicted present. More... | |
SamplerPtr | _train_sampler |
Number of points used to calculate commission. More... | |
SamplerPtr | _test_sampler |
Wraps up a single Algorithm run and its results (calculated error components). Also handles multi-threading aspects of computation.
Definition at line 47 of file AlgorithmRun.hh.
AlgorithmRun::AlgorithmRun | ( | const AlgorithmPtr & | algo | ) |
Definition at line 53 of file AlgorithmRun.cpp.
AlgorithmRun::~AlgorithmRun | ( | ) |
Definition at line 67 of file AlgorithmRun.cpp.
|
private |
AlgorithmRun::AlgorithmRun | ( | ) |
Definition at line 65 of file garp_run.cpp.
AlgorithmRun::AlgorithmRun | ( | const AlgorithmPtr & | alg | ) |
|
virtual |
|
private |
int AlgorithmRun::calculateCommission | ( | ) |
Definition at line 130 of file AlgorithmRun.cpp.
References _alg, _commission, _commission_samples, and _train_sampler.
Referenced by AlgorithmRunThreadProc(), and createModel().
int AlgorithmRun::calculateCommission | ( | ) |
int AlgorithmRun::calculateOmission | ( | ) |
Definition at line 165 of file AlgorithmRun.cpp.
References _alg, _omission, _test_sampler, and _train_sampler.
Referenced by AlgorithmRunThreadProc(), and createModel().
int AlgorithmRun::calculateOmission | ( | ) |
void AlgorithmRun::createModel | ( | ) |
Definition at line 107 of file AlgorithmRun.cpp.
References _alg, _commission, _omission, _train_sampler, ConfusionMatrix::calculate(), calculateCommission(), calculateOmission(), ConfusionMatrix::getCommissionError(), and ConfusionMatrix::getOmissionError().
Referenced by AlgorithmRunThreadProc().
int AlgorithmRun::done | ( | ) | const |
Definition at line 141 of file garp_run.cpp.
References _alg.
Referenced by AlgorithmRunThreadProc().
int AlgorithmRun::finalize | ( | ) |
Definition at line 149 of file garp_run.cpp.
References _running, and THREAD_END.
Referenced by AlgorithmRunThreadProc().
|
inline |
Definition at line 72 of file garp_run.hh.
References _alg.
|
inline |
Definition at line 73 of file AlgorithmRun.hh.
References _alg.
Referenced by BestSubsets::_getConfiguration(), and AbstractBestSubsets::_getConfiguration().
double AlgorithmRun::getCommission | ( | ) | const |
Definition at line 198 of file AlgorithmRun.cpp.
References _commission.
Referenced by printListOfRuns(), and BestSubsets::printListOfRuns().
double AlgorithmRun::getCommission | ( | ) | const |
double AlgorithmRun::getError | ( | int | type | ) | const |
Definition at line 202 of file AlgorithmRun.cpp.
References _commission, and _omission.
Referenced by AbstractBestSubsets::sortRuns(), and BestSubsets::sortRuns().
double AlgorithmRun::getError | ( | int | type | ) | const |
|
inline |
Definition at line 63 of file AlgorithmRun.hh.
References _id.
Referenced by printListOfRuns(), and BestSubsets::printListOfRuns().
|
inline |
Definition at line 66 of file garp_run.hh.
References _id.
double AlgorithmRun::getOmission | ( | ) | const |
Definition at line 194 of file AlgorithmRun.cpp.
References _omission.
Referenced by AbstractBestSubsets::numActiveThreads(), and BestSubsets::numActiveThreads().
double AlgorithmRun::getOmission | ( | ) | const |
float AlgorithmRun::getProgress | ( | ) | const |
Definition at line 126 of file AlgorithmRun.cpp.
References _alg.
Referenced by BestSubsets::getProgress(), and AbstractBestSubsets::getProgress().
float AlgorithmRun::getProgress | ( | ) | const |
double AlgorithmRun::getValue | ( | const Sample & | x | ) | const |
Definition at line 211 of file AlgorithmRun.cpp.
References _alg.
Referenced by BestSubsets::getValue(), and AbstractBestSubsets::getValue().
int AlgorithmRun::initialize | ( | int | id, |
int | comm_samples, | ||
const SamplerPtr & | train_sampler, | ||
const SamplerPtr & | test_sampler | ||
) |
Definition at line 73 of file AlgorithmRun.cpp.
References _commission_samples, _id, _test_sampler, and _train_sampler.
Referenced by BestSubsets::iterate(), and AbstractBestSubsets::iterate().
int AlgorithmRun::initialize | ( | int | id, |
int | comm_samples, | ||
const SamplerPtr & | train_sampler, | ||
const SamplerPtr & | test_sampler, | ||
int | nparam, | ||
AlgParameter * | param, | ||
BSAlgorithmFactory * | factory | ||
) |
Definition at line 98 of file garp_run.cpp.
References _alg, _commission_samples, _id, _test_sampler, _train_sampler, Log::debug(), BSAlgorithmFactory::getBSAlgorithm(), and Log::instance().
int AlgorithmRun::iterate | ( | ) |
Definition at line 134 of file garp_run.cpp.
References _alg.
Referenced by AlgorithmRunThreadProc().
|
private |
|
private |
int AlgorithmRun::run | ( | ) |
Definition at line 87 of file AlgorithmRun.cpp.
References _running, AlgorithmRunThreadProc(), and THREAD_START.
Referenced by BestSubsets::iterate(), and AbstractBestSubsets::iterate().
int AlgorithmRun::run | ( | ) |
bool AlgorithmRun::running | ( | ) | const |
Definition at line 101 of file AlgorithmRun.cpp.
References _running.
Referenced by AbstractBestSubsets::numActiveThreads(), and BestSubsets::numActiveThreads().
bool AlgorithmRun::running | ( | ) | const |
void AlgorithmRun::stop | ( | ) |
Definition at line 93 of file AlgorithmRun.cpp.
References _running, and THREAD_END.
Referenced by AlgorithmRunThreadProc().
|
private |
Number of points used to calculate commission.
Definition at line 77 of file AlgorithmRun.hh.
Referenced by calculateCommission(), calculateOmission(), createModel(), done(), getAlgorithm(), getProgress(), getValue(), initialize(), and iterate().
|
private |
Omission error for this run.
Definition at line 82 of file AlgorithmRun.hh.
Referenced by calculateCommission(), createModel(), getCommission(), and getError().
|
private |
Commission error, approximated by area predicted present.
Definition at line 83 of file AlgorithmRun.hh.
Referenced by calculateCommission(), and initialize().
|
private |
Algorithm used in this run.
Definition at line 79 of file AlgorithmRun.hh.
Referenced by getId(), and initialize().
|
private |
Indicates whether the thread is running.
Definition at line 81 of file AlgorithmRun.hh.
Referenced by calculateOmission(), createModel(), getError(), and getOmission().
|
private |
Identified for this particular garp run.
Definition at line 80 of file AlgorithmRun.hh.
Referenced by finalize(), run(), running(), and stop().
|
private |
Definition at line 85 of file AlgorithmRun.hh.
Referenced by calculateOmission(), and initialize().
|
private |
Number of points used to calculate commission.
Algorithm used in this run.
Definition at line 84 of file AlgorithmRun.hh.
Referenced by calculateCommission(), calculateOmission(), createModel(), and initialize().