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-2009 Soeren Sonnenburg 00008 * Copyright (C) 2006-2009 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/LinearClassifier.h" 00016 #include "features/DotFeatures.h" 00017 #include "features/Labels.h" 00018 00019 namespace shogun 00020 { 00022 class CSVMLin : public CLinearClassifier 00023 { 00024 public: 00026 CSVMLin(); 00027 00034 CSVMLin( 00035 float64_t C, CDotFeatures* traindat, 00036 CLabels* trainlab); 00037 virtual ~CSVMLin(); 00038 00043 virtual inline EClassifierType get_classifier_type() { return CT_SVMLIN; } 00044 00053 virtual bool train(CFeatures* data=NULL); 00054 00060 inline void set_C(float64_t c1, float64_t c2) { C1=c1; C2=c2; } 00061 00066 inline float64_t get_C1() { return C1; } 00067 00072 inline float64_t get_C2() { return C2; } 00073 00078 inline void set_bias_enabled(bool enable_bias) { use_bias=enable_bias; } 00079 00084 inline bool get_bias_enabled() { return use_bias; } 00085 00090 inline void set_epsilon(float64_t eps) { epsilon=eps; } 00091 00096 inline float64_t get_epsilon() { return epsilon; } 00097 00099 inline virtual const char* get_name() const { return "SVMLin"; } 00100 00101 protected: 00103 float64_t C1; 00105 float64_t C2; 00107 float64_t epsilon; 00108 00110 bool use_bias; 00111 }; 00112 } 00113 #endif