openModeller  Version 1.5.0
svm_alg.hh
Go to the documentation of this file.
1 
27 #ifndef _SVM_ALGHH_
28 #define _SVM_ALGHH_
29 
30 #include <openmodeller/om.hh>
31 
32 #include "svm.h"
33 
34 /**************************************************/
35 /************* Support Vector Machines ************/
36 
41 {
42 public:
43 
44  SvmAlgorithm();
45 
46  ~SvmAlgorithm();
47 
48  int needNormalization();
49  int initialize();
50  int iterate();
51  int done() const;
52 
53  Scalar getValue( const Sample& x ) const;
54  int getConvergence( Scalar * const val ) const;
55 
56 protected:
57 
58  void _getNode( svm_node * node, const Sample& sample ) const;
59 
60  void _getConfiguration( ConfigurationPtr& ) const;
61 
63 
64  bool _done;
65 
67 
68  svm_parameter _svm_parameter;
69 
70  svm_problem _svm_problem;
71 
73 
74  // Index of presence class in SVM arrays. No need to serialize it since it is
75  // detected at run time. -1 means "to be determined".
77 };
78 
79 
80 #endif
81 
void _getConfiguration(ConfigurationPtr &) const
Definition: svm_alg.cpp:688
void _getNode(svm_node *node, const Sample &sample) const
Definition: svm_alg.cpp:673
double Scalar
Type of map values.
Definition: om_defs.hh:39
int _num_layers
Definition: svm_alg.hh:66
int done() const
Definition: svm_alg.cpp:619
svm_problem _svm_problem
Definition: svm_alg.hh:70
bool _done
Definition: svm_alg.hh:64
int needNormalization()
Definition: svm_alg.cpp:301
int initialize()
Definition: svm_alg.cpp:330
int _presence_index
Definition: svm_alg.hh:76
int iterate()
Definition: svm_alg.cpp:589
int getConvergence(Scalar *const val) const
Definition: svm_alg.cpp:664
svm_model * _svm_model
Definition: svm_alg.hh:72
void _setConfiguration(const ConstConfigurationPtr &)
Definition: svm_alg.cpp:758
svm_parameter _svm_parameter
Definition: svm_alg.hh:68
Scalar getValue(const Sample &x) const
Definition: svm_alg.cpp:627
Definition: Sample.hh:25