SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SVMLin.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2006-2009 Soeren Sonnenburg
8  * Copyright (C) 2006-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _SVMLIN_H___
12 #define _SVMLIN_H___
13 
14 #include <shogun/lib/common.h>
17 #include <shogun/features/Labels.h>
18 
19 namespace shogun
20 {
22 class CSVMLin : public CLinearMachine
23 {
24  public:
26  CSVMLin();
27 
34  CSVMLin(
35  float64_t C, CDotFeatures* traindat,
36  CLabels* trainlab);
37  virtual ~CSVMLin();
38 
43  virtual inline EClassifierType get_classifier_type() { return CT_SVMLIN; }
44 
51  inline void set_C(float64_t c_neg, float64_t c_pos) { C1=c_neg; C2=c_pos; }
52 
57  inline float64_t get_C1() { return C1; }
58 
63  inline float64_t get_C2() { return C2; }
64 
69  inline void set_bias_enabled(bool enable_bias) { use_bias=enable_bias; }
70 
75  inline bool get_bias_enabled() { return use_bias; }
76 
81  inline void set_epsilon(float64_t eps) { epsilon=eps; }
82 
87  inline float64_t get_epsilon() { return epsilon; }
88 
90  inline virtual const char* get_name() const { return "SVMLin"; }
91 
92  protected:
101  virtual bool train_machine(CFeatures* data=NULL);
102 
103  protected:
110 
112  bool use_bias;
113 };
114 }
115 #endif
class SVMLin
Definition: SVMLin.h:22
EClassifierType
Definition: Machine.h:27
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
float64_t C1
Definition: SVMLin.h:105
bool use_bias
Definition: SVMLin.h:112
void set_epsilon(float64_t eps)
Definition: SVMLin.h:81
float64_t get_C2()
Definition: SVMLin.h:63
Features that support dot products among other operations.
Definition: DotFeatures.h:41
virtual EClassifierType get_classifier_type()
Definition: SVMLin.h:43
float64_t epsilon
Definition: SVMLin.h:109
void set_C(float64_t c_neg, float64_t c_pos)
Definition: SVMLin.h:51
bool get_bias_enabled()
Definition: SVMLin.h:75
float64_t get_epsilon()
Definition: SVMLin.h:87
virtual ~CSVMLin()
Definition: SVMLin.cpp:35
float64_t get_C1()
Definition: SVMLin.h:57
double float64_t
Definition: common.h:56
virtual const char * get_name() const
Definition: SVMLin.h:90
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
Definition: LinearMachine.h:61
virtual bool train_machine(CFeatures *data=NULL)
Definition: SVMLin.cpp:39
The class Features is the base class of all feature objects.
Definition: Features.h:56
void set_bias_enabled(bool enable_bias)
Definition: SVMLin.h:69
float64_t C2
Definition: SVMLin.h:107

SHOGUN Machine Learning Toolbox - Documentation