SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GUIConverter.cpp
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) 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 {
49  return true;
50 }
51 
53 {
56  return true;
57 }
58 
60 {
63  return true;
64 }
65 
67 {
70  return true;
71 }
72 
74 {
77  return true;
78 }
79 
81 {
83  ((CLaplacianEigenmaps*)m_converter)->set_k(k);
84  ((CLaplacianEigenmaps*)m_converter)->set_tau(width);
85  return true;
86 }
87 
89 {
92  ((CLocalityPreservingProjections*)m_converter)->set_tau(width);
93  return true;
94 }
95 
97 {
99  ((CDiffusionMaps*)m_converter)->set_t(t);
100  ((CDiffusionMaps*)m_converter)->set_kernel(new CGaussianKernel(100,width));
101  return true;
102 }
103 
105 {
106  m_converter = new CIsomap();
107  ((CIsomap*)m_converter)->set_k(k);
108  return true;
109 }
110 
112 {
114  return true;
115 }
116 
118 {
119  m_converter = new CJade();
120  return true;
121 }
122 
124 {
125  if (!m_converter)
126  SG_ERROR("No converter created")
127  return (CDenseFeatures<float64_t>*)m_converter->apply(m_ui->ui_features->get_train_features());
128 }
129 
131 {
132  if (!m_converter)
133  SG_ERROR("No converter created")
134  ((CEmbeddingConverter*)m_converter)->set_target_dim(target_dim);
135  return ((CEmbeddingConverter*)m_converter)->embed(m_ui->ui_features->get_train_features());
136 }
137 
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:36
#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:39
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:115
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:55
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:58
bool create_diffusionmaps(int32_t t, float64_t width)
CSGInterface * m_ui
Definition: GUIConverter.h:79
CConverter * m_converter
Definition: GUIConverter.h:76

SHOGUN Machine Learning Toolbox - Documentation