source: trunk/src/SVM.h @ 36

Last change on this file since 36 was 36, checked in by Peter, 19 years ago

stop criteria for the traing modified

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1// $Id: SVM.h 36 2004-02-12 10:29:21Z peter $
2
3#ifndef CS_CPP_TOOLS_SVM_H
4#define CS_CPP_TOOLS_SVM_H
5
6// C++ tools include
7/////////////////////
8#include "vector.h"
9#include "matrix.h"
10
11// Standard C++ includes
12////////////////////////
13
14
15namespace thep_cpp_tools
16{
17 
18  class SVM
19  {
20 
21  public:
22    /**
23       Constructor taking the kernel matrix and the target vector as input
24    */
25    SVM(const thep_gsl_api::matrix&, const thep_gsl_api::vector&);
26           
27    /**
28       Training the SVM using the SMO algorithm
29    */
30    void train();
31
32    /**
33       Function will return \f$\alpha\f$
34    */
35    inline thep_gsl_api::vector get_alpha() const;
36   
37     
38  private:
39    bool trained_;
40    thep_gsl_api::matrix kernel_;
41    thep_gsl_api::vector target_;
42    thep_gsl_api::vector alpha_;
43
44    /**
45       Private function that determines when to stop the training
46    */
47    bool SVM::stop(const thep_gsl_api::vector& target_,
48       const thep_gsl_api::matrix& kernel_,
49       const thep_gsl_api::vector& alpha_);
50  };
51 
52    // class SVM
53  thep_gsl_api::vector SVM::get_alpha() const 
54  {
55    return alpha_;
56  }
57}; // namespace thep_c++_tools
58
59#endif
60
Note: See TracBrowser for help on using the repository browser.