openModeller  Version 1.5.0
SvmAlgorithm Class Reference

#include <svm_alg.hh>

Inheritance diagram for SvmAlgorithm:
Inheritance graph
Collaboration diagram for SvmAlgorithm:
Collaboration graph

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
 
NormalizergetNormalizer () 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
 

Detailed Description

Declaration of SVM algorithm class.

Author
Renato De Giovanni (renato [at] cria org br)
Id:
svm_alg.hh 5013 2009-05-07 19:37:16Z rdg

LICENSE INFORMATION

Copyright(c) 2007 by CRIA - Centro de Referencia em Informacao Ambiental

http://www.cria.org.br

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.

Constructor & Destructor Documentation

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.

Member Function Documentation

void SvmAlgorithm::_getConfiguration ( ConfigurationPtr config) const
protectedvirtual
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().

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.

Parameters
xEnvironmental conditions.
Returns
The occurrence probability in the range [0,1].

Implements AlgorithmImpl.

Definition at line 627 of file svm_alg.cpp.

References _getNode(), _num_layers, _presence_index, _svm_model, and _svm_parameter.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

Member Data Documentation

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
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().


The documentation for this class was generated from the following files: