SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
GUIKernel.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) 1999-2008 Soeren Sonnenburg
8  * Written (W) 1999-2008 Gunnar Raetsch
9  * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
11 
12 #ifndef __GUIKERNEL__H
13 #define __GUIKERNEL__H
14 
15 #include <shogun/lib/config.h>
16 #include <shogun/base/SGObject.h>
17 #include <shogun/kernel/Kernel.h>
18 
19 namespace shogun
20 {
21 class CSGInterface;
22 
24 class CGUIKernel : public CSGObject
25 {
26  public:
28  CGUIKernel() { };
32  CGUIKernel(CSGInterface* interface);
33 
35  ~CGUIKernel();
36 
40  bool set_normalization(char* normalization, float64_t c=0.0, float64_t r=0.0);
42  bool set_kernel(CKernel* kern);
44  bool add_kernel(CKernel* kern, float64_t weight=1);
46  bool del_last_kernel();
47 
49  bool init_kernel(const char* target);
55  bool save_kernel(char* filename);
57  bool clean_kernel();
58 
60  bool set_optimization_type(char* opt_type);
62  bool precompute_subkernels();
63 
65  bool is_initialized() { return initialized; }
66 
68  CKernel* create_oligo(int32_t size, int32_t k, float64_t width);
70  CKernel* create_diag(int32_t size=10, float64_t diag=1);
72  CKernel* create_const(int32_t size=10, float64_t c=1);
74  CKernel* create_custom(float64_t* kmatrix, int32_t num_feat, int32_t num_vec,
75  bool source_is_diag, bool dest_is_diag);
78  int32_t size=10, float64_t width=1, int32_t max_shift=0,
79  int32_t shift_step=1);
81  CKernel* create_sparsegaussian(int32_t size=10, float64_t width=1);
83  CKernel* create_gaussian(int32_t size=10, float64_t width=1);
86  int32_t size=10, float64_t gamma=0.01, float64_t coef0=0);
89  int32_t size, float64_t* km, int32_t rows, int32_t cols);
92  int32_t size=10, int32_t degree=2, bool inhomogene=false,
93  bool normalize=true);
96  int32_t size=10, int32_t degree=2, bool inhomogene=false,
97  bool normalize=true);
100  int32_t size=10, float64_t Wdilation=5.0, float64_t Wtranslation=2.0);
103  int32_t size=10, int32_t length=3, int32_t inner_degree=3,
104  int32_t outer_degree=1, EKernelType ktype=K_LOCALITYIMPROVED);
107  int32_t size=10, int32_t order=3, int32_t max_mismatch=1,
108  bool use_normalization=true, int32_t mkl_stepsize=1,
109  bool block_computation=true, int32_t single_degree=-1);
112  int32_t size=10, int32_t order=3, int32_t max_mismatch=1,
113  int32_t length=0, int32_t center=0, float64_t step=1);
116  int32_t size=10, int32_t order=3, int32_t max_mismatch=1,
117  int32_t* shifts=NULL, int32_t length=0, int32_t mkl_stepsize=1,
118  float64_t* position_weights=NULL);
121  int32_t size=10, int32_t order=3, int32_t max_mismatch=1,
122  int32_t* shifts=NULL, int32_t length=0, bool use_normalization=true);
124  CKernel* create_weighteddegreerbf(int32_t size=10, int32_t degree=1, int32_t nof_properties=1, float64_t width=1);
126  CKernel* create_spectrummismatchrbf(int32_t size=10, float64_t* AA_matrix = NULL, int32_t nr=128, int32_t nc=128, int32_t max_mismatch=1, int32_t degree=1, float64_t width=1);
128  CKernel* create_localalignmentstring(int32_t size=10);
130  CKernel* create_fixeddegreestring(int32_t size=10, int32_t d=3);
132  CKernel* create_chi2(int32_t size=10, float64_t width=1);
135  int32_t size=10, bool use_sign=false, char* norm_str=NULL,
139  int32_t size=10, int32_t d=3, bool normalize=true);
142  int32_t size=10, int32_t degree=2, bool inhomogene=false,
143  bool normalize=true);
146  int32_t size=10, int32_t degree=2, bool inhomogene=false,
147  bool normalize=true);
149  CKernel* create_salzbergword(int32_t size=10);
151  CKernel* create_histogramword(int32_t size=10);
153  CKernel* create_linearbyte(int32_t size=10, float64_t scale=-1);
155  CKernel* create_linearword(int32_t size=10, float64_t scale=-1);
157  CKernel* create_linearstring(int32_t size=10, float64_t scale=-1);
159  CKernel* create_linear(int32_t size=10, float64_t scale=-1);
161  CKernel* create_sparselinear(int32_t size=10, float64_t scale=-1);
163  CKernel* create_distance(int32_t size=10, float64_t width=1);
166  int32_t size=10, bool append_subkernel_weights=false);
167 
169  virtual const char* get_name() const { return "GUIKernel"; }
170 
171  protected:
175  CSGInterface* ui;
178 
179  private:
180  float64_t* get_weights(int32_t order, int32_t max_mismatch);
181 };
182 }
183 #endif

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