SHOGUN
v3.2.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 1999-2009 Soeren Sonnenburg 00008 * Written (W) 2013 Heiko Strathmann 00009 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00010 */ 00011 00012 #ifndef _LIBSVR_H___ 00013 #define _LIBSVR_H___ 00014 00015 #include <stdio.h> 00016 00017 #include <shogun/lib/common.h> 00018 #include <shogun/classifier/svm/SVM.h> 00019 #include <shogun/lib/external/shogun_libsvm.h> 00020 #include <shogun/regression/Regression.h> 00021 00022 namespace shogun 00023 { 00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS 00064 enum LIBSVR_SOLVER_TYPE 00065 { 00066 LIBSVR_EPSILON_SVR = 1, 00067 LIBSVR_NU_SVR = 2 00068 }; 00069 #endif 00070 class CLibSVR : public CSVM 00071 { 00072 public: 00074 MACHINE_PROBLEM_TYPE(PT_REGRESSION); 00075 00077 CLibSVR(); 00078 00087 CLibSVR(float64_t C, float64_t svr_param, CKernel* k, CLabels* lab, 00088 LIBSVR_SOLVER_TYPE st=LIBSVR_EPSILON_SVR); 00089 00090 virtual ~CLibSVR(); 00091 00096 virtual EMachineType get_classifier_type(); 00097 00099 virtual const char* get_name() const { return "LibSVR"; } 00100 00101 protected: 00110 virtual bool train_machine(CFeatures* data=NULL); 00111 protected: 00113 svm_problem problem; 00115 svm_parameter param; 00116 00118 struct svm_model* model; 00119 00121 LIBSVR_SOLVER_TYPE solver_type; 00122 }; 00123 } 00124 #endif