SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EmbeddingConverter.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) 2011 Sergey Lisitsyn
8  * Copyright (C) 2011 Sergey Lisitsyn
9  */
10 
15 
16 using namespace shogun;
17 
18 namespace shogun
19 {
21 : CConverter()
22 {
23  m_target_dim = 1;
25  m_kernel = new CLinearKernel();
26 
27  init();
28 }
29 
31 {
34 }
35 
37 {
38  return (CSimpleFeatures<float64_t>*)apply(features);
39 }
40 
42 {
43  ASSERT(dim>0);
44  m_target_dim = dim;
45 }
46 
48 {
49  return m_target_dim;
50 }
51 
53 {
55  SG_REF(distance);
56  m_distance = distance;
57 }
58 
60 {
62  return m_distance;
63 }
64 
66 {
68  SG_REF(kernel);
69  m_kernel = kernel;
70 }
71 
73 {
75  return m_kernel;
76 }
77 
79 {
80  this->m_parameters->add(&m_target_dim, "target_dim",
81  "target dimensionality of preprocessor");
82  this->m_parameters->add((CSGObject**)&m_distance, "distance",
83  "distance to be used for embedding");
84  this->m_parameters->add((CSGObject**)&m_kernel, "kernel",
85  "kernel to be used for embedding");
86 }
87 }
class Converter used to convert data
Definition: Converter.h:24
Computes the standard linear kernel on CDotFeatures.
Definition: LinearKernel.h:33
virtual CSimpleFeatures< float64_t > * embed(CFeatures *features)
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:77
CDistance * get_distance() const
Parameter * m_parameters
Definition: SGObject.h:297
#define SG_REF(x)
Definition: SGObject.h:44
void set_kernel(CKernel *kernel)
void add(bool *param, const char *name, const char *description="")
Definition: Parameter.cpp:23
void set_distance(CDistance *distance)
#define ASSERT(x)
Definition: SGIO.h:102
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:76
class EuclidianDistance
#define SG_UNREF(x)
Definition: SGObject.h:45
The class Features is the base class of all feature objects.
Definition: Features.h:56
The Kernel base class.
Definition: Kernel.h:172
virtual CFeatures * apply(CFeatures *features)=0

SHOGUN Machine Learning Toolbox - Documentation