Last change
on this file since 30 was
30,
checked in by Peter, 19 years ago
|
adding SVM
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
901 bytes
|
Line | |
---|
1 | // $Id: SVM.h 30 2004-01-16 17:40:51Z 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 | |
---|
15 | namespace 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 | // class SVM |
---|
46 | thep_gsl_api::vector SVM::get_alpha() const |
---|
47 | { |
---|
48 | return alpha_; |
---|
49 | } |
---|
50 | }; // namespace thep_c++_tools |
---|
51 | |
---|
52 | #endif |
---|
53 | |
---|
Note: See
TracBrowser
for help on using the repository browser.