openModeller
Version 1.4.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 |
Protected Member Functions | |
void | _getNode (svm_node *node, const Sample &sample) const |
void | _getConfiguration (ConfigurationPtr &) const |
void | _setConfiguration (const ConstConfigurationPtr &) |
Protected Attributes | |
bool | _done |
int | _num_layers |
svm_parameter | _svm_parameter |
svm_problem | _svm_problem |
svm_model * | _svm_model |
int | _presence_index |
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.
Definition at line 260 of file svm_alg.cpp.
References AlgorithmImpl::_normalizerPtr, _svm_model, and _svm_problem.
Definition at line 279 of file svm_alg.cpp.
References _svm_model, and _svm_problem.
void SvmAlgorithm::_getConfiguration | ( | ConfigurationPtr & | config | ) | const [protected, virtual] |
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.
void SvmAlgorithm::_getNode | ( | svm_node * | node, |
const Sample & | sample | ||
) | const [protected] |
Definition at line 673 of file svm_alg.cpp.
References _num_layers.
Referenced by getValue(), and initialize().
void SvmAlgorithm::_setConfiguration | ( | const ConstConfigurationPtr & | config | ) | [protected, virtual] |
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.
int SvmAlgorithm::done | ( | ) | const [virtual] |
Return != 0 if algorithm finished.
Reimplemented from AlgorithmImpl.
Definition at line 619 of file svm_alg.cpp.
References _done.
Referenced by needNormalization().
int SvmAlgorithm::getConvergence | ( | Scalar *const | val | ) | const [virtual] |
Returns the algorithm's convergence value at the moment
Reimplemented from AlgorithmImpl.
Definition at line 664 of file svm_alg.cpp.
Scalar SvmAlgorithm::getValue | ( | const Sample & | x | ) | const [virtual] |
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.
int SvmAlgorithm::initialize | ( | ) | [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().
int SvmAlgorithm::iterate | ( | ) | [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.
int SvmAlgorithm::needNormalization | ( | ) | [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.
bool SvmAlgorithm::_done [protected] |
Definition at line 64 of file svm_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), done(), and iterate().
int SvmAlgorithm::_num_layers [protected] |
Definition at line 66 of file svm_alg.hh.
Referenced by _getConfiguration(), _getNode(), _setConfiguration(), getValue(), and initialize().
int SvmAlgorithm::_presence_index [protected] |
Definition at line 76 of file svm_alg.hh.
Referenced by _setConfiguration(), getValue(), and iterate().
svm_model* SvmAlgorithm::_svm_model [protected] |
Definition at line 72 of file svm_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), getValue(), iterate(), SvmAlgorithm(), and ~SvmAlgorithm().
svm_parameter SvmAlgorithm::_svm_parameter [protected] |
Definition at line 68 of file svm_alg.hh.
Referenced by _getConfiguration(), _setConfiguration(), getValue(), initialize(), and iterate().
svm_problem SvmAlgorithm::_svm_problem [protected] |
Definition at line 70 of file svm_alg.hh.
Referenced by initialize(), iterate(), SvmAlgorithm(), and ~SvmAlgorithm().