SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCA.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) 1999-2008 Gunnar Raetsch
8  * Written (W) 1999-2008,2011 Soeren Sonnenburg
9  * Written (W) 2014 Parijat Mazumdar
10  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
11  * Copyright (C) 2011 Berlin Institute of Technology
12  */
13 
14 #ifndef PCA_H_
15 #define PCA_H_
16 
17 #include <shogun/lib/config.h>
18 
19 #ifdef HAVE_EIGEN3
22 #include <shogun/lib/common.h>
23 
24 namespace shogun
25 {
28 {
32  AUTO = 10,
34  SVD = 20,
38  EVD = 30
39 };
40 
43 {
50 };
51 
54 {
65 };
66 
114 {
115  public:
116 
125  CPCA(bool do_whitening=false, EPCAMode mode=FIXED_NUMBER, float64_t thresh=1e-6,
126  EPCAMethod method=AUTO, EPCAMemoryMode mem_mode=MEM_REALLOCATE);
127 
134  CPCA(EPCAMethod method, bool do_whitening=false, EPCAMemoryMode mem=MEM_REALLOCATE);
135 
137  virtual ~CPCA();
138 
142  virtual bool init(CFeatures* features);
143 
145  virtual void cleanup();
146 
152 
158 
163 
167 
171 
173  virtual const char* get_name() const { return "PCA"; }
174 
176  virtual EPreprocessorType get_type() const { return P_PCA; }
177 
180 
185 
189  void set_eigenvalue_zero_tolerance(float64_t eigenvalue_zero_tolerance=1e-15);
190 
195 
196  protected:
197 
198  void init();
199 
200  protected:
201 
205  int32_t num_dim;
207  int32_t num_old_dim;
229 };
230 }
231 #endif // HAVE_EIGEN3
232 #endif // PCA_H_

SHOGUN Machine Learning Toolbox - Documentation