openModeller
Version 1.5.0
|
#include <AbstractBestSubsets.hh>
Protected Member Functions | |
virtual void | _getConfiguration (ConfigurationPtr &) const |
virtual void | _setConfiguration (const ConstConfigurationPtr &) |
Protected Member Functions inherited from AlgorithmImpl | |
int | dimDomain () |
int | getParameter (std::string const &name, std::string *value) |
int | getParameter (std::string const &name, double *value) |
int | getParameter (std::string const &name, float *value) |
int | getParameter (std::string const &name, int *value) |
Protected Attributes | |
std::string | _subAlgorithm |
Protected Attributes inherited from AlgorithmImpl | |
SamplerPtr | _samp |
Normalizer * | _normalizerPtr |
ParamSetType | _param |
Private Member Functions | |
int | numActiveThreads () |
int | earlyTerminationConditionMet () |
int | calculateBestSubset () |
void | sortRuns (AlgorithmRun **runList, int nelements, int errorType) |
Private Attributes | |
double | _trainProp |
int | _totalRuns |
double | _omissionThreshold |
int | _modelsUnderOmission |
double | _commissionThreshold |
int | _commissionSampleSize |
int | _maxThreads |
bool | _softOmissionThreshold |
int | _currentModelsUnderOmissionThreshold |
AlgorithmRun ** | _finishedRun |
AlgorithmRun ** | _activeRun |
AlgorithmRun ** | _bestRun |
int | _numFinishedRuns |
int | _numActiveRuns |
int | _numBestRuns |
int | _done |
float | _maxProgress |
Additional Inherited Members | |
Public Types inherited from AlgorithmImpl | |
typedef std::map< icstring, std::string > | ParamSetType |
Declaration of Best Subsets Procedure base class
LICENSE INFORMATION
Copyright(c), The Center for Research, University of Kansas, 2385 Irving Hill Road, Lawrence, KS 66044-4755, USA.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details:
http://www.gnu.org/copyleft/gpl.html Implements Best Subset Procedure (Anderson et al. 2003).
It runs "n" Garp models, filter the best ones based on the procedure defined by Anderson et al. 2003 and sum them to obtain a probability map for the species distribution.
Current implementation uses multi-threading to run multiple Garp runs in parallel. Takes advantage of multi-processor servers and workstations.
Definition at line 53 of file AbstractBestSubsets.hh.
AbstractBestSubsets::AbstractBestSubsets | ( | AlgMetadata const * | metadata_bs | ) |
Definition at line 64 of file AbstractBestSubsets.cpp.
References _activeRun, _bestRun, _commissionSampleSize, _commissionThreshold, _currentModelsUnderOmissionThreshold, _done, _finishedRun, _maxProgress, _maxThreads, _modelsUnderOmission, _numActiveRuns, _numFinishedRuns, _omissionThreshold, _softOmissionThreshold, _totalRuns, and _trainProp.
|
pure virtual |
Definition at line 91 of file AbstractBestSubsets.cpp.
References _activeRun, _bestRun, _finishedRun, and _numFinishedRuns.
|
protectedvirtual |
Reimplemented from AlgorithmImpl.
Definition at line 114 of file AbstractBestSubsets.cpp.
References _bestRun, _done, _numBestRuns, and AlgorithmRun::getAlgorithm().
|
protectedvirtual |
Reimplemented from AlgorithmImpl.
Definition at line 141 of file AbstractBestSubsets.cpp.
References _bestRun, _done, _numBestRuns, and AlgorithmFactory::newAlgorithm().
|
private |
Definition at line 423 of file AbstractBestSubsets.cpp.
References _bestRun, _commissionThreshold, _finishedRun, _modelsUnderOmission, _numBestRuns, _numFinishedRuns, _totalRuns, Log::info(), Log::instance(), printListOfRuns(), and sortRuns().
Referenced by iterate().
|
virtual |
Check if the model generation is completed (e.g. convergence point has been met.
Reimplemented from AlgorithmImpl.
Definition at line 500 of file AbstractBestSubsets.cpp.
References _done.
Referenced by getProgress().
|
private |
Definition at line 416 of file AbstractBestSubsets.cpp.
References _currentModelsUnderOmissionThreshold, _modelsUnderOmission, and _softOmissionThreshold.
Referenced by iterate().
|
virtual |
Returns a value that represents the convergence of the algorithm expressed as a number between 0 and 1 where 0 represents model completion.
val |
Reimplemented from AlgorithmImpl.
Definition at line 560 of file AbstractBestSubsets.cpp.
|
virtual |
Return progress so far
Reimplemented from AlgorithmImpl.
Definition at line 508 of file AbstractBestSubsets.cpp.
References _activeRun, _currentModelsUnderOmissionThreshold, _maxProgress, _modelsUnderOmission, _numActiveRuns, _numFinishedRuns, _softOmissionThreshold, _totalRuns, done(), and AlgorithmRun::getProgress().
This method is used when projecting the model.
x | Pointer to a vector of openModeller Scalar type (currently double). The vector should contain values looked up on the environmental variable layers into which the mode is being projected. |
Implements AlgorithmImpl.
Definition at line 543 of file AbstractBestSubsets.cpp.
References _bestRun, _done, _numBestRuns, and AlgorithmRun::getValue().
|
virtual |
Initialize data structures
Implements AlgorithmImpl.
Definition at line 228 of file AbstractBestSubsets.cpp.
References _activeRun, _commissionSampleSize, _commissionThreshold, _finishedRun, _maxThreads, _modelsUnderOmission, _omissionThreshold, _softOmissionThreshold, _subAlgorithm, _totalRuns, _trainProp, Log::error(), AlgorithmImpl::getParameter(), Log::instance(), and Log::warn().
|
virtual |
Start model execution (build the model). Consists of a single GARP run. It is also the control loop for the threads
Reimplemented from AlgorithmImpl.
Definition at line 311 of file AbstractBestSubsets.cpp.
References _activeRun, _commissionSampleSize, _done, _maxThreads, _numActiveRuns, _numFinishedRuns, AlgorithmImpl::_param, AlgorithmImpl::_samp, _subAlgorithm, _totalRuns, _trainProp, calculateBestSubset(), earlyTerminationConditionMet(), AlgorithmRun::initialize(), AlgorithmFactory::newAlgorithm(), numActiveThreads(), AlgorithmRun::run(), SLEEP, and splitSampler().
|
virtual |
This method is used when you want to ensure that all variables in all environmental layers are scaled to the same value range. GARP requires values to be normalized between -1.0 and 1.0.
Reimplemented from AlgorithmImpl.
Definition at line 191 of file AbstractBestSubsets.cpp.
References AlgorithmImpl::_normalizerPtr, AlgorithmImpl::_samp, _subAlgorithm, Normalizer::computeNormalization(), error, Log::error(), AlgorithmImpl::getParameter(), Log::info(), Log::instance(), AlgorithmFactory::newAlgorithm(), and AlgorithmImpl::setNormalization().
|
private |
Definition at line 383 of file AbstractBestSubsets.cpp.
References _activeRun, _currentModelsUnderOmissionThreshold, _finishedRun, _numActiveRuns, _numFinishedRuns, _omissionThreshold, _softOmissionThreshold, AlgorithmRun::getOmission(), and AlgorithmRun::running().
Referenced by iterate().
|
private |
Definition at line 470 of file AbstractBestSubsets.cpp.
References AlgorithmRun::getError().
Referenced by calculateBestSubset().
|
private |
Definition at line 141 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), getProgress(), initialize(), iterate(), numActiveThreads(), and ~AbstractBestSubsets().
|
private |
Definition at line 142 of file AbstractBestSubsets.hh.
Referenced by _getConfiguration(), _setConfiguration(), AbstractBestSubsets(), calculateBestSubset(), getValue(), and ~AbstractBestSubsets().
|
private |
Definition at line 131 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), initialize(), and iterate().
|
private |
Definition at line 130 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), calculateBestSubset(), and initialize().
|
private |
Definition at line 135 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), earlyTerminationConditionMet(), getProgress(), and numActiveThreads().
|
private |
Definition at line 148 of file AbstractBestSubsets.hh.
Referenced by _getConfiguration(), _setConfiguration(), AbstractBestSubsets(), done(), getValue(), and iterate().
|
private |
Definition at line 140 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), calculateBestSubset(), initialize(), numActiveThreads(), and ~AbstractBestSubsets().
|
mutableprivate |
Definition at line 150 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), and getProgress().
|
private |
Definition at line 132 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), initialize(), and iterate().
|
private |
Definition at line 129 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), calculateBestSubset(), earlyTerminationConditionMet(), getProgress(), and initialize().
|
private |
Definition at line 145 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), getProgress(), iterate(), and numActiveThreads().
|
private |
Definition at line 146 of file AbstractBestSubsets.hh.
Referenced by _getConfiguration(), _setConfiguration(), calculateBestSubset(), and getValue().
|
private |
Definition at line 144 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), calculateBestSubset(), getProgress(), iterate(), numActiveThreads(), and ~AbstractBestSubsets().
|
private |
Definition at line 128 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), initialize(), and numActiveThreads().
|
private |
Definition at line 134 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), earlyTerminationConditionMet(), getProgress(), initialize(), and numActiveThreads().
|
mutableprotected |
Definition at line 115 of file AbstractBestSubsets.hh.
Referenced by DgGarpBestSubsets::DgGarpBestSubsets(), initialize(), iterate(), and needNormalization().
|
private |
Definition at line 127 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), calculateBestSubset(), getProgress(), initialize(), and iterate().
|
private |
Definition at line 126 of file AbstractBestSubsets.hh.
Referenced by AbstractBestSubsets(), initialize(), and iterate().