SHOGUN  v3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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>
16 #include <shogun/lib/external/shogun_libsvm.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();
33 
38  CLibSVM(LIBSVM_SOLVER_TYPE st);
39 
47  CLibSVM(float64_t C, CKernel* k, CLabels* lab,
48  LIBSVM_SOLVER_TYPE st=LIBSVM_C_SVC);
49 
50  virtual ~CLibSVM();
51 
57 
59  virtual const char* get_name() const { return "LibSVM"; }
60 
61  protected:
70  virtual bool train_machine(CFeatures* data=NULL);
71 
72  protected:
74  svm_problem problem;
76  svm_parameter param;
78  struct svm_model* model;
79 
81  LIBSVM_SOLVER_TYPE solver_type;
82 };
83 }
84 #endif
EMachineType
Definition: Machine.h:33
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:81
svm_parameter param
Definition: LibSVM.h:76
struct svm_model * model
Definition: LibSVM.h:78
double float64_t
Definition: common.h:48
svm_problem problem
Definition: LibSVM.h:74
virtual bool train_machine(CFeatures *data=NULL)
Definition: LibSVM.cpp:39
virtual const char * get_name() const
Definition: LibSVM.h:59
The class Features is the base class of all feature objects.
Definition: Features.h:62
A generic Support Vector Machine Interface.
Definition: SVM.h:47
The Kernel base class.
Definition: Kernel.h:150
virtual ~CLibSVM()
Definition: LibSVM.cpp:34
virtual EMachineType get_classifier_type()
Definition: LibSVM.h:56

SHOGUN Machine Learning Toolbox - Documentation