SHOGUN  v3.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
LibSVM.h
Go to the documentation of this file.
00001 /*
00002  * This program is free software; you can redistribute it and/or modify
00003  * it under the terms of the GNU General Public License as published by
00004  * the Free Software Foundation; either version 3 of the License, or
00005  * (at your option) any later version.
00006  *
00007  * Written (W) 1999-2009 Soeren Sonnenburg
00008  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
00009  */
00010 
00011 #ifndef _LIBSVM_H___
00012 #define _LIBSVM_H___
00013 
00014 #include <shogun/lib/common.h>
00015 #include <shogun/classifier/svm/SVM.h>
00016 #include <shogun/lib/external/shogun_libsvm.h>
00017 
00018 namespace shogun
00019 {
00020 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00021 enum LIBSVM_SOLVER_TYPE
00022 {
00023     LIBSVM_C_SVC = 1,
00024     LIBSVM_NU_SVC = 2
00025 };
00026 #endif
00027 
00028 class CLibSVM : public CSVM
00029 {
00030     public:
00032         CLibSVM();
00033 
00038         CLibSVM(LIBSVM_SOLVER_TYPE st);
00039 
00047         CLibSVM(float64_t C, CKernel* k, CLabels* lab,
00048                 LIBSVM_SOLVER_TYPE st=LIBSVM_C_SVC);
00049 
00050         virtual ~CLibSVM();
00051 
00056         virtual EMachineType get_classifier_type() { return CT_LIBSVM; }
00057 
00059         virtual const char* get_name() const { return "LibSVM"; }
00060 
00061     protected:
00070         virtual bool train_machine(CFeatures* data=NULL);
00071 
00072     protected:
00074         svm_problem problem;
00076         svm_parameter param;
00078         struct svm_model* model;
00079 
00081         LIBSVM_SOLVER_TYPE solver_type;
00082 };
00083 }
00084 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation