openModeller
Version 1.5.0
|
#include <svm_alg.hh>
Public Member Functions | |
SvmAlgorithm () | |
~SvmAlgorithm () | |
int | needNormalization () |
int | initialize () |
int | iterate () |
int | done () const |
Scalar | getValue (const Sample &x) const |
int | getConvergence (Scalar *const val) const |
Public Member Functions inherited from AlgorithmImpl | |
AlgorithmImpl (AlgMetadata const *metadata) | |
virtual | ~AlgorithmImpl () |
void | setParameters (int nparam, AlgParameter const *param) |
void | setParameters (const ParamSetType &) |
std::string const | getID () const |
AlgMetadata const * | getMetadata () const |
AlgorithmPtr | getFreshCopy () |
virtual int | supportsModelProjection () const |
Model | createModel (const SamplerPtr &samp, CallbackWrapper *func=0) |
void | setSampler (const SamplerPtr &samp) |
virtual int | finalize () |
virtual float | getProgress () const |
Normalizer * | getNormalizer () const |
void | setNormalization (const SamplerPtr &samp) const |
void | setNormalization (const EnvironmentPtr &env) const |
virtual Model | getModel () const |
ConfigurationPtr | getConfiguration () const |
void | setConfiguration (const ConstConfigurationPtr &) |
Public Member Functions inherited from Configurable | |
virtual | ~Configurable () |
Protected Member Functions | |
void | _getNode (svm_node *node, const Sample &sample) const |
void | _getConfiguration (ConfigurationPtr &) const |
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 | |
bool | _done |
int | _num_layers |
svm_parameter | _svm_parameter |
svm_problem | _svm_problem |
svm_model * | _svm_model |
int | _presence_index |
Protected Attributes inherited from AlgorithmImpl | |
SamplerPtr | _samp |
Normalizer * | _normalizerPtr |
ParamSetType | _param |
Additional Inherited Members | |
Public Types inherited from AlgorithmImpl | |
typedef std::map< icstring, std::string > | ParamSetType |
Declaration of SVM algorithm class.
LICENSE INFORMATION
Copyright(c) 2007 by CRIA - Centro de Referencia em Informacao Ambiental
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 Algorithm to generate models using Support Vector Machines.
Definition at line 40 of file svm_alg.hh.
SvmAlgorithm::SvmAlgorithm | ( | ) |
Definition at line 260 of file svm_alg.cpp.
References AlgorithmImpl::_normalizerPtr, _svm_model, and _svm_problem.
SvmAlgorithm::~SvmAlgorithm | ( | ) |
Definition at line 279 of file svm_alg.cpp.
References _svm_model, and _svm_problem.
|
protectedvirtual |
Reimplemented from AlgorithmImpl.
Definition at line 688 of file svm_alg.cpp.
References _done, _num_layers, _svm_model, _svm_parameter, svm_model::l, svm_model::nSV, svm_model::probA, svm_model::probB, svm_model::rho, svm_model::SV, and svm_model::sv_coef.
|
protected |
Definition at line 673 of file svm_alg.cpp.
References _num_layers.
Referenced by getValue(), and initialize().
|
protectedvirtual |
Reimplemented from AlgorithmImpl.
Definition at line 758 of file svm_alg.cpp.
References _done, _num_layers, _presence_index, _svm_model, _svm_parameter, svm_model::free_sv, svm_model::l, svm_model::label, svm_model::nr_class, svm_model::nSV, svm_model::param, svm_model::probA, svm_model::probB, svm_model::rho, svm_model::SV, svm_model::sv_coef, and UNUSED.
|
virtual |
Return != 0 if algorithm finished.
Reimplemented from AlgorithmImpl.
Definition at line 619 of file svm_alg.cpp.
References _done.
Referenced by needNormalization().
|
virtual |
Returns the algorithm's convergence value at the moment
Reimplemented from AlgorithmImpl.
Definition at line 664 of file svm_alg.cpp.
The algorithm must return the occurrence probability at the given environment conditions.
x | Environmental conditions. |
Implements AlgorithmImpl.
Definition at line 627 of file svm_alg.cpp.
References _getNode(), _num_layers, _presence_index, _svm_model, and _svm_parameter.
|
virtual |
Initiate a new training.
Implements AlgorithmImpl.
Definition at line 330 of file svm_alg.cpp.
References _getNode(), AlgorithmImpl::_normalizerPtr, _num_layers, AlgorithmImpl::_samp, _svm_parameter, _svm_problem, C_ID, COEF0_ID, Normalizer::computeNormalization(), createSampler(), DEGREE_ID, Log::error(), GAMMA_ID, AlgorithmImpl::getParameter(), Log::info(), Log::instance(), KERNELTYPE_ID, NU_ID, PROB_ID, PSEUDO_ID, AlgorithmImpl::setNormalization(), SVM_LOG_PREFIX, SVMTYPE_ID, and Log::warn().
|
virtual |
One step further on the training. Return 0 if something wrong happened.
Reimplemented from AlgorithmImpl.
Definition at line 589 of file svm_alg.cpp.
References _done, _presence_index, _svm_model, _svm_parameter, _svm_problem, Log::error(), Log::instance(), and SVM_LOG_PREFIX.
|
virtual |
The algorithm should return != 0 if it needs normalization of environmental variables (non categorical ones).
Reimplemented from AlgorithmImpl.
Definition at line 301 of file svm_alg.cpp.
References AlgorithmImpl::_normalizerPtr, AlgorithmImpl::_samp, done(), AlgorithmImpl::getParameter(), and SVMTYPE_ID.
|
protected |
Definition at line 64 of file svm_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), done(), and iterate().
|
protected |
Definition at line 66 of file svm_alg.hh.
Referenced by _getConfiguration(), _getNode(), _setConfiguration(), getValue(), and initialize().
|
protected |
Definition at line 76 of file svm_alg.hh.
Referenced by _setConfiguration(), getValue(), and iterate().
|
protected |
Definition at line 72 of file svm_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), getValue(), iterate(), SvmAlgorithm(), and ~SvmAlgorithm().
|
protected |
Definition at line 68 of file svm_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), getValue(), initialize(), and iterate().
|
protected |
Definition at line 70 of file svm_alg.hh.
Referenced by initialize(), iterate(), SvmAlgorithm(), and ~SvmAlgorithm().