SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LibSVM.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) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _LIBSVM_H___
12 #define _LIBSVM_H___
13 
14 #include <shogun/lib/common.h>
17 
18 namespace shogun
19 {
20 #ifndef DOXYGEN_SHOULD_SKIP_THIS
21 enum LIBSVM_SOLVER_TYPE
22 {
23  LIBSVM_C_SVC = 1,
24  LIBSVM_NU_SVC = 2
25 };
26 #endif
27 
28 class CLibSVM : public CSVM
29 {
30  public:
32  CLibSVM(LIBSVM_SOLVER_TYPE st=LIBSVM_C_SVC);
33 
40  CLibSVM(float64_t C, CKernel* k, CLabels* lab);
41 
42  virtual ~CLibSVM();
43 
48  virtual inline EClassifierType get_classifier_type() { return CT_LIBSVM; }
49 
51  inline virtual const char* get_name() const { return "LibSVM"; }
52 
53  protected:
62  virtual bool train_machine(CFeatures* data=NULL);
63 
64  protected:
66  svm_problem problem;
68  svm_parameter param;
70  struct svm_model* model;
71 
73  LIBSVM_SOLVER_TYPE solver_type;
74 };
75 }
76 #endif
EClassifierType
Definition: Machine.h:27
LibSVM.
Definition: LibSVM.h:28
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
LIBSVM_SOLVER_TYPE solver_type
Definition: LibSVM.h:73
svm_parameter param
Definition: LibSVM.h:68
struct svm_model * model
Definition: LibSVM.h:70
double float64_t
Definition: common.h:56
svm_problem problem
Definition: LibSVM.h:66
virtual bool train_machine(CFeatures *data=NULL)
Definition: LibSVM.cpp:32
virtual const char * get_name() const
Definition: LibSVM.h:51
virtual EClassifierType get_classifier_type()
Definition: LibSVM.h:48
The class Features is the base class of all feature objects.
Definition: Features.h:56
A generic Support Vector Machine Interface.
Definition: SVM.h:46
The Kernel base class.
Definition: Kernel.h:172
CLibSVM(LIBSVM_SOLVER_TYPE st=LIBSVM_C_SVC)
Definition: LibSVM.cpp:16
virtual ~CLibSVM()
Definition: LibSVM.cpp:27

SHOGUN Machine Learning Toolbox - Documentation