SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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 
14 
15 using namespace shogun;
16 
17 namespace shogun
18 {
20 : CConverter()
21 {
22  m_target_dim = 1;
24  m_kernel = new CLinearKernel();
25 
26  init();
27 }
28 
30 {
33 }
34 
36 {
37  return (CDenseFeatures<float64_t>*)apply(features);
38 }
39 
41 {
42  ASSERT(dim>0)
43  m_target_dim = dim;
44 }
45 
47 {
48  return m_target_dim;
49 }
50 
52 {
53  SG_REF(distance);
56 }
57 
59 {
61  return m_distance;
62 }
63 
65 {
66  SG_REF(kernel);
68  m_kernel = kernel;
69 }
70 
72 {
74  return m_kernel;
75 }
76 
78 {
79  SG_ADD(&m_target_dim, "target_dim",
80  "target dimensionality of preprocessor", MS_AVAILABLE);
81  SG_ADD((CSGObject**)&m_distance, "distance",
82  "distance to be used for embedding", MS_AVAILABLE);
83  SG_ADD((CSGObject**)&m_kernel, "kernel", "kernel to be used for embedding",
84  MS_AVAILABLE);
85 }
86 }
float distance(CJLCoverTreePoint p1, CJLCoverTreePoint p2, float64_t upper_bound)
class Converter used to convert data
Definition: Converter.h:26
Computes the standard linear kernel on CDotFeatures.
Definition: LinearKernel.h:35
Class Distance, a base class for all the distances used in the Shogun toolbox.
Definition: Distance.h:81
CDistance * get_distance() const
#define SG_REF(x)
Definition: SGObject.h:51
void set_kernel(CKernel *kernel)
void set_distance(CDistance *distance)
#define ASSERT(x)
Definition: SGIO.h:201
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
#define SG_UNREF(x)
Definition: SGObject.h:52
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual CDenseFeatures< float64_t > * embed(CFeatures *features)
The class Features is the base class of all feature objects.
Definition: Features.h:68
The Kernel base class.
Definition: Kernel.h:158
#define SG_ADD(...)
Definition: SGObject.h:81
class EuclideanDistance
virtual CFeatures * apply(CFeatures *features)=0

SHOGUN Machine Learning Toolbox - Documentation