SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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/config.h>
15 
16 #include <shogun/lib/common.h>
18 #include <shogun/lib/external/shogun_libsvm.h>
19 
20 namespace shogun
21 {
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 enum LIBSVM_SOLVER_TYPE
24 {
25  LIBSVM_C_SVC = 1,
26  LIBSVM_NU_SVC = 2
27 };
28 #endif
29 
30 class CLibSVM : public CSVM
31 {
32  public:
34  CLibSVM();
35 
40  CLibSVM(LIBSVM_SOLVER_TYPE st);
41 
49  CLibSVM(float64_t C, CKernel* k, CLabels* lab,
50  LIBSVM_SOLVER_TYPE st=LIBSVM_C_SVC);
51 
52  virtual ~CLibSVM();
53 
59 
61  virtual const char* get_name() const { return "LibSVM"; }
62 
63  protected:
72  virtual bool train_machine(CFeatures* data=NULL);
73 
74  protected:
76  svm_problem problem;
78  svm_parameter param;
80  struct svm_model* model;
81 
83  LIBSVM_SOLVER_TYPE solver_type;
84 };
85 }
86 #endif
EMachineType
Definition: Machine.h:33
LibSVM.
Definition: LibSVM.h:30
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
LIBSVM_SOLVER_TYPE solver_type
Definition: LibSVM.h:83
svm_parameter param
Definition: LibSVM.h:78
struct svm_model * model
Definition: LibSVM.h:80
double float64_t
Definition: common.h:50
svm_problem problem
Definition: LibSVM.h:76
virtual bool train_machine(CFeatures *data=NULL)
Definition: LibSVM.cpp:39
virtual const char * get_name() const
Definition: LibSVM.h:61
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
A generic Support Vector Machine Interface.
Definition: SVM.h:49
The Kernel base class.
Definition: Kernel.h:158
virtual ~CLibSVM()
Definition: LibSVM.cpp:34
virtual EMachineType get_classifier_type()
Definition: LibSVM.h:58

SHOGUN Machine Learning Toolbox - Documentation