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) 2006-2008 Soeren Sonnenburg 00008 * Copyright (C) 2006-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _SVMLIN_H___ 00012 #define _SVMLIN_H___ 00013 00014 #include "lib/common.h" 00015 #include "classifier/SparseLinearClassifier.h" 00016 #include "features/SparseFeatures.h" 00017 #include "features/Labels.h" 00018 00020 class CSVMLin : public CSparseLinearClassifier 00021 { 00022 public: 00024 CSVMLin(); 00025 00032 CSVMLin(DREAL C, CSparseFeatures<DREAL>* traindat, CLabels* trainlab); 00033 virtual ~CSVMLin(); 00034 00039 virtual inline EClassifierType get_classifier_type() { return CT_SVMLIN; } 00040 00042 virtual bool train(); 00043 00049 inline void set_C(DREAL c1, DREAL c2) { C1=c1; C2=c2; } 00050 00055 inline DREAL get_C1() { return C1; } 00056 00061 inline DREAL get_C2() { return C2; } 00062 00067 inline void set_bias_enabled(bool enable_bias) { use_bias=enable_bias; } 00068 00073 inline bool get_bias_enabled() { return use_bias; } 00074 00079 inline void set_epsilon(DREAL eps) { epsilon=eps; } 00080 00085 inline DREAL get_epsilon() { return epsilon; } 00086 00087 protected: 00089 DREAL C1; 00091 DREAL C2; 00093 DREAL epsilon; 00094 00096 bool use_bias; 00097 }; 00098 #endif