SHOGUN  3.2.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/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

SHOGUN Machine Learning Toolbox - Documentation