pktools  2.6.7
Processing Kernel for geospatial data
CostFactorySVM.h
1 /**********************************************************************
2 CostFactorySVM.h: select features, typical use: feature selection for classification
3 Copyright (C) 2008-2012 Pieter Kempeneers
4 
5 This file is part of pktools
6 
7 pktools is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 pktools is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with pktools. If not, see <http://www.gnu.org/licenses/>.
19 ***********************************************************************/
20 #ifndef _COSTFACTORYSVM_H_
21 #define _COSTFACTORYSVM_H_
22 
23 #include <math.h>
24 #include <vector>
25 #include <map>
26 #include "base/Vector2d.h"
27 #include "CostFactory.h"
28 
29 namespace svm{
30  enum SVM_TYPE {C_SVC=0, nu_SVC=1,one_class=2, epsilon_SVR=3, nu_SVR=4};
31  enum KERNEL_TYPE {linear=0,polynomial=1,radial=2,sigmoid=3};
32 }
33 
35 {
36 public:
38 CostFactorySVM(std::string svm_type, std::string kernel_type, unsigned short kernel_degree, float gamma, float coef0, float ccost, float nu, float epsilon_loss, int cache, float epsilon_tol, bool shrinking, bool prob_est, unsigned short cv, short verbose);
40 double getCost(const std::vector<Vector2d<float> > &trainingFeatures);
41 
42 private:
43 std::string m_svm_type;
44 std::string m_kernel_type;
45 unsigned short m_kernel_degree;
46 float m_gamma;
47 float m_coef0;
48 float m_ccost;
49 float m_nu;
50 float m_epsilon_loss;
51 int m_cache;
52 float m_epsilon_tol;
53 bool m_shrinking;
54 bool m_prob_est;
55 };
56 #endif