Changeset 453 for trunk/test/kernel_test.cc
- Timestamp:
- Dec 15, 2005, 10:49:23 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/kernel_test.cc
r446 r453 6 6 #include <c++_tools/gslapi/matrix.h> 7 7 #include <c++_tools/gslapi/vector.h> 8 #include <c++_tools/ svm/KernelFunction.h>9 #include <c++_tools/ svm/PolynomialKernelFunction.h>10 #include <c++_tools/ svm/GaussianKernelFunction.h>11 #include <c++_tools/ svm/KernelView.h>12 #include <c++_tools/ svm/Kernel_MEV.h>13 #include <c++_tools/ svm/Kernel_SEV.h>8 #include <c++_tools/classifier/KernelFunction.h> 9 #include <c++_tools/classifier/PolynomialKernelFunction.h> 10 #include <c++_tools/classifier/GaussianKernelFunction.h> 11 #include <c++_tools/classifier/KernelView.h> 12 #include <c++_tools/classifier/Kernel_MEV.h> 13 #include <c++_tools/classifier/Kernel_SEV.h> 14 14 15 15 #include <cmath> … … 21 21 using namespace theplu; 22 22 23 bool test_MEV(const gslapi::matrix& data, const svm::KernelFunction* kf,23 bool test_MEV(const gslapi::matrix& data, const classifier::KernelFunction* kf, 24 24 const gslapi::matrix& control, const double error_bound) 25 25 { 26 svm::Kernel_MEV kernel(data,*kf);26 classifier::Kernel_MEV kernel(data,*kf); 27 27 for(u_int i=0;i<control.rows();i++) 28 28 for(u_int j=0;j<control.columns();j++) … … 35 35 index[1]=2; 36 36 index[2]=3; 37 svm::KernelView(kernel,index);37 classifier::KernelView(kernel,index); 38 38 39 39 return true; 40 40 } 41 41 42 bool test_SEV(const gslapi::matrix& data, const svm::KernelFunction* kf,42 bool test_SEV(const gslapi::matrix& data, const classifier::KernelFunction* kf, 43 43 const gslapi::matrix& control, const double error_bound) 44 44 { 45 svm::Kernel_SEV kernel(data,*kf);45 classifier::Kernel_SEV kernel(data,*kf); 46 46 for(u_int i=0;i<control.rows();i++) 47 47 for(u_int j=0;j<control.columns();j++) … … 54 54 index[1]=2; 55 55 index[2]=3; 56 svm::KernelView(kernel,index);56 classifier::KernelView(kernel,index); 57 57 return true; 58 58 } … … 84 84 gslapi::matrix kernel_matlab(is); 85 85 is.close(); 86 svm::KernelFunction* kf = new svm::PolynomialKernelFunction();86 classifier::KernelFunction* kf = new classifier::PolynomialKernelFunction(); 87 87 ok = (ok && test_MEV(data,kf,kernel_matlab,error_bound) 88 88 & test_SEV(data,kf,kernel_matlab,error_bound)); … … 92 92 gslapi::matrix kernel_matlab2(is); 93 93 is.close(); 94 kf = new svm::PolynomialKernelFunction(2);94 kf = new classifier::PolynomialKernelFunction(2); 95 95 ok = (ok && test_MEV(data,kf,kernel_matlab2,error_bound) 96 96 & test_SEV(data,kf,kernel_matlab2,error_bound)); … … 99 99 // Checking that a GaussianKernelFunction object can be built at 100 100 // compile time. 101 kf = new svm::GaussianKernelFunction();101 kf = new classifier::GaussianKernelFunction(); 102 102 delete kf; 103 103
Note: See TracChangeset
for help on using the changeset viewer.