pktools 2.6.7
Processing Kernel for geospatial data
CostFactorySVM.h
1/**********************************************************************
2CostFactorySVM.h: select features, typical use: feature selection for classification
3Copyright (C) 2008-2012 Pieter Kempeneers
4
5This file is part of pktools
6
7pktools is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 3 of the License, or
10(at your option) any later version.
11
12pktools is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along 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
29namespace 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{
36public:
38CostFactorySVM(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);
40double getCost(const std::vector<Vector2d<float> > &trainingFeatures);
41
42private:
43std::string m_svm_type;
44std::string m_kernel_type;
45unsigned short m_kernel_degree;
46float m_gamma;
47float m_coef0;
48float m_ccost;
49float m_nu;
50float m_epsilon_loss;
51int m_cache;
52float m_epsilon_tol;
53bool m_shrinking;
54bool m_prob_est;
55};
56#endif