SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
GUIConverter.cpp
浏览该文件的文档.
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) 2012 Sergey Lisitsyn
8  * Copyright (C) 2012 Sergey Lisitsyn
9  */
10 
11 #include <shogun/ui/GUIConverter.h>
12 #include <shogun/ui/SGInterface.h>
13 
14 #include <shogun/lib/config.h>
15 #include <shogun/io/SGIO.h>
18 
31 
32 using namespace shogun;
33 
35 : CSGObject(), m_ui(ui)
36 {
37  m_converter = NULL;
38 }
39 
41 {
43 }
44 
46 {
47 #ifdef HAVE_EIGEN3
50 #else
51  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
52 #endif
53  return true;
54 }
55 
57 {
58 #ifdef HAVE_EIGEN3
61 #else
62  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
63 #endif
64  return true;
65 }
66 
68 {
69 #ifdef HAVE_EIGEN3
72 #else
73  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
74 #endif
75  return true;
76 }
77 
79 {
80 #ifdef HAVE_EIGEN3
83 #else
84  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
85 #endif
86  return true;
87 }
88 
90 {
91 #ifdef HAVE_EIGEN3
94 #else
95  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
96 #endif
97  return true;
98 }
99 
101 {
102 #ifdef HAVE_EIGEN3
104  ((CLaplacianEigenmaps*)m_converter)->set_k(k);
105  ((CLaplacianEigenmaps*)m_converter)->set_tau(width);
106 #else
107  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
108 #endif
109  return true;
110 }
111 
113 {
114 #ifdef HAVE_EIGEN3
117  ((CLocalityPreservingProjections*)m_converter)->set_tau(width);
118 #else
119  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
120 #endif
121  return true;
122 }
123 
125 {
126 #ifdef HAVE_EIGEN3
127  m_converter = new CDiffusionMaps();
128  ((CDiffusionMaps*)m_converter)->set_t(t);
129  ((CDiffusionMaps*)m_converter)->set_kernel(new CGaussianKernel(100,width));
130 #else
131  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
132 #endif
133  return true;
134 }
135 
137 {
138 #ifdef HAVE_EIGEN3
139  m_converter = new CIsomap();
140  ((CIsomap*)m_converter)->set_k(k);
141 #else
142  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
143 #endif
144  return true;
145 }
146 
148 {
149 #ifdef HAVE_EIGEN3
151 #else
152  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
153 #endif
154  return true;
155 }
156 
158 {
159 #ifdef HAVE_EIGEN3
160  m_converter = new CJade();
161 #else
162  SG_ERROR("Requires EIGEN3 to be enabled at compile time\n")
163 #endif
164  return true;
165 }
166 
168 {
169  if (!m_converter)
170  SG_ERROR("No converter created")
171  return (CDenseFeatures<float64_t>*)m_converter->apply(m_ui->ui_features->get_train_features());
172 }
173 
175 {
176  if (!m_converter)
177  SG_ERROR("No converter created")
178  ((CEmbeddingConverter*)m_converter)->set_target_dim(target_dim);
179  return ((CEmbeddingConverter*)m_converter)->embed(m_ui->ui_features->get_train_features());
180 }
181 
class LinearLocalTangentSpaceAlignment converter used to construct embeddings as described in: ...
bool create_locallylinearembedding(int32_t k)
bool create_linearlocaltangentspacealignment(int32_t k)
bool create_hessianlocallylinearembedding(int32_t k)
class EmbeddingConverter (part of the Efficient Dimensionality Reduction Toolkit) used to construct e...
bool create_multidimensionalscaling()
class Jade
Definition: Jade.h:37
#define SG_ERROR(...)
Definition: SGIO.h:129
bool create_neighborhoodpreservingembedding(int32_t k)
class LocalTangentSpaceAlignment used to embed data using Local Tangent Space Alignment (LTSA) algori...
class DiffusionMaps used to preprocess given data using Diffusion Maps dimensionality reduction techn...
Definition: DiffusionMaps.h:40
bool create_localtangentspacealignment(int32_t k)
class LocalityPreservingProjections used to compute embeddings of data using Locality Preserving Proj...
class Multidimensionalscaling is used to perform multidimensional scaling (capable of landmark approx...
NeighborhoodPreservingEmbedding converter used to construct embeddings as described in: ...
bool create_laplacianeigenmaps(int32_t k, float64_t width)
bool create_isomap(int32_t k)
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
double float64_t
Definition: common.h:50
CDenseFeatures< float64_t > * apply()
class LocallyLinearEmbedding used to embed data using Locally Linear Embedding algorithm described in...
CDenseFeatures< float64_t > * embed(int32_t target_dim)
bool create_localitypreservingprojections(int32_t k, float64_t width)
The well known Gaussian kernel (swiss army knife for SVMs) computed on CDotFeatures.
virtual CFeatures * apply(CFeatures *features)=0
class HessianLocallyLinearEmbedding used to preprocess data using Hessian Locally Linear Embedding al...
class LaplacianEigenmaps used to construct embeddings of data using Laplacian Eigenmaps algorithm as ...
#define SG_UNREF(x)
Definition: SGObject.h:52
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The Isomap class is used to embed data using Isomap algorithm as described in:
Definition: Isomap.h:59
bool create_diffusionmaps(int32_t t, float64_t width)
CSGInterface * m_ui
Definition: GUIConverter.h:79
CConverter * m_converter
Definition: GUIConverter.h:76

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