SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ScatterSVM.h
浏览该文件的文档.
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) 2009 Soeren Sonnenburg
8  * Written (W) 2009 Marius Kloft
9  * Copyright (C) 2009 TU Berlin and Max-Planck-Society
10  */
11 
12 #ifndef _SCATTERSVM_H___
13 #define _SCATTERSVM_H___
14 
15 #include <shogun/lib/common.h>
16 #include <shogun/lib/config.h>
18 #include <shogun/lib/external/shogun_libsvm.h>
19 
20 
21 namespace shogun
22 {
25  {
28 #ifdef USE_SVMLIGHT
31 #endif //USE_SVMLIGHT
32  TEST_RULE1,
36  };
37 
53 {
54  public:
56  CScatterSVM();
57 
60 
67  CScatterSVM(float64_t C, CKernel* k, CLabels* lab);
68 
70  virtual ~CScatterSVM();
71 
77 
83  virtual float64_t apply_one(int32_t num);
84 
89  virtual CLabels* classify_one_vs_rest();
90 
92  virtual const char* get_name() const { return "ScatterSVM"; }
93 
94  protected:
103  virtual bool train_machine(CFeatures* data=NULL);
104 
105  private:
106  void compute_norm_wc();
107  virtual bool train_no_bias_libsvm();
108 #ifdef USE_SVMLIGHT
109  virtual bool train_no_bias_svmlight();
110 #endif //USE_SVMLIGHT
111  virtual bool train_testrule12();
112 
113  protected:
116 
118  svm_problem problem;
120  svm_parameter param;
121 
123  struct svm_model* model;
124 
127 
130 
133 
135  int32_t m_num_classes;
136 };
137 }
138 #endif // ScatterSVM
EMachineType
Definition: Machine.h:33
virtual bool train_machine(CFeatures *data=NULL)
Definition: ScatterSVM.cpp:49
float64_t * norm_wcw
Definition: ScatterSVM.h:129
virtual float64_t apply_one(int32_t num)
Definition: ScatterSVM.cpp:488
no bias w/ libsvm
Definition: ScatterSVM.h:27
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
float64_t * norm_wc
Definition: ScatterSVM.h:126
class MultiClassSVM
Definition: MulticlassSVM.h:28
no bias w/ svmlight
Definition: ScatterSVM.h:30
virtual ~CScatterSVM()
Definition: ScatterSVM.cpp:43
double float64_t
Definition: common.h:50
SCATTER_TYPE scatter_type
Definition: ScatterSVM.h:115
ScatterSVM - Multiclass SVM.
Definition: ScatterSVM.h:52
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
SCATTER_TYPE
Definition: ScatterSVM.h:24
training with bias using test rule 2
Definition: ScatterSVM.h:35
The class Features is the base class of all feature objects.
Definition: Features.h:68
training with bias using test rule 1
Definition: ScatterSVM.h:33
virtual EMachineType get_classifier_type()
Definition: ScatterSVM.h:76
The Kernel base class.
Definition: Kernel.h:158
svm_parameter param
Definition: ScatterSVM.h:120
virtual CLabels * classify_one_vs_rest()
Definition: ScatterSVM.cpp:378
virtual const char * get_name() const
Definition: ScatterSVM.h:92
svm_problem problem
Definition: ScatterSVM.h:118
struct svm_model * model
Definition: ScatterSVM.h:123

SHOGUN 机器学习工具包 - 项目文档