SHOGUN  v3.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RandomFourierGaussPreproc.h
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) 2010-2011 Alexander Binder
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  * Copyright (C) 2010-2011 Berlin Institute of Technology
10  */
11 
12 #ifndef _RANDOMFOURIERGAUSSPREPROC__H__
13 #define _RANDOMFOURIERGAUSSPREPROC__H__
14 
15 #include <vector>
16 #include <algorithm>
17 
18 #include <shogun/lib/common.h>
21 
22 namespace shogun {
50 public:
53 
56 
61 
67  virtual SGMatrix<float64_t> apply_to_feature_matrix(CFeatures* features); // ref count fo the feature matrix???
68 
69 
76 
81 
86 
94  virtual bool init(CFeatures *f);
95 
99  void set_kernelwidth(const float64_t width);
100 
105  float64_t get_kernelwidth( ) const;
106 
112  void get_randomcoefficients(float64_t ** randomcoeff_additive2,
113  float64_t ** randomcoeff_multiplicative2,
114  int32_t *dim_feature_space2, int32_t *dim_input_space2, float64_t* kernelwidth2 ) const;
115 
122  void set_randomcoefficients(float64_t *randomcoeff_additive2,
123  float64_t * randomcoeff_multiplicative2,
124  const int32_t dim_feature_space2, const int32_t dim_input_space2, const float64_t kernelwidth2);
125 
130  void set_dim_input_space(const int32_t dim);
131 
137  void set_dim_feature_space(const int32_t dim);
138 
151 
152 
156  int32_t get_dim_input_space() const;
157 
161  int32_t get_dim_feature_space() const;
162 
166  void cleanup();
167 
169  virtual const char* get_name() const { return "RandomFourierGaussPreproc"; }
170 
172  virtual EPreprocessorType get_type() const { return P_RANDOMFOURIERGAUSS; }
173 
174 protected:
175 
179  void copy(const CRandomFourierGaussPreproc & feats); // helper for two constructors
180 
181 
186 
191 
196 
201 
202 
207 
212 
216  bool test_rfinited() const;
217 
223 
229 };
230 }
231 #endif
EPreprocessorType
Definition: Preprocessor.h:30
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
EFeatureClass
shogun feature class
Definition: FeatureTypes.h:35
virtual const char * get_name() const
return the name of the preprocessor
void set_randomcoefficients(float64_t *randomcoeff_additive2, float64_t *randomcoeff_multiplicative2, const int32_t dim_feature_space2, const int32_t dim_input_space2, const float64_t kernelwidth2)
Template class DensePreprocessor, base class for preprocessors (cf. CPreprocessor) that apply to CDen...
double float64_t
Definition: common.h:48
void copy(const CRandomFourierGaussPreproc &feats)
EFeatureType
shogun feature type
Definition: FeatureTypes.h:16
The class Features is the base class of all feature objects.
Definition: Features.h:62
Preprocessor CRandomFourierGaussPreproc implements Random Fourier Features for the Gauss kernel a la ...
void get_randomcoefficients(float64_t **randomcoeff_additive2, float64_t **randomcoeff_multiplicative2, int32_t *dim_feature_space2, int32_t *dim_input_space2, float64_t *kernelwidth2) const
virtual EPreprocessorType get_type() const
return a type of preprocessor
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)

SHOGUN Machine Learning Toolbox - Documentation