SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
PCA.h
浏览该文件的文档.
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  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  * Copyright (C) 2011 Berlin Institute of Technology
11  */
12 
13 #ifndef PCA_H_
14 #define PCA_H_
15 #include <shogun/lib/config.h>
16 #ifdef HAVE_LAPACK
18 #include <stdio.h>
21 #include <shogun/lib/common.h>
22 
23 namespace shogun
24 {
27 {
34 };
35 
49 {
50  public:
51 
57  CPCA(bool do_whitening=false, EPCAMode mode=FIXED_NUMBER, float64_t thresh=1e-6);
58 
60  virtual ~CPCA();
61 
65  virtual bool init(CFeatures* features);
66 
68  virtual void cleanup();
69 
75 
81 
86 
90 
94 
96  virtual const char* get_name() const { return "PCA"; }
97 
99  virtual EPreprocessorType get_type() const { return P_PCA; }
100 
101  protected:
102 
103  void init();
104 
105  protected:
106 
110  int32_t num_dim;
112  int32_t num_old_dim;
125 };
126 }
127 #endif
128 #endif
the class DimensionReductionPreprocessor, a base class for preprocessors used to lower the dimensiona...
SGVector< float64_t > m_mean_vector
Definition: PCA.h:114
int32_t num_old_dim
Definition: PCA.h:112
EPreprocessorType
Definition: Preprocessor.h:30
EPCAMode m_mode
Definition: PCA.h:122
float64_t thresh
Definition: PCA.h:124
virtual void cleanup()
Definition: PCA.cpp:173
SGVector< float64_t > m_eigenvalues_vector
Definition: PCA.h:116
CPCA(bool do_whitening=false, EPCAMode mode=FIXED_NUMBER, float64_t thresh=1e-6)
Definition: PCA.cpp:26
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
Definition: PCA.cpp:221
void init()
Definition: PCA.cpp:33
SGMatrix< float64_t > m_transformation_matrix
Definition: PCA.h:108
virtual EPreprocessorType get_type() const
Definition: PCA.h:99
virtual const char * get_name() const
Definition: PCA.h:96
SGVector< float64_t > get_mean()
Definition: PCA.cpp:249
int32_t num_dim
Definition: PCA.h:110
bool m_initialized
Definition: PCA.h:118
double float64_t
Definition: common.h:48
bool m_whitening
Definition: PCA.h:120
SGVector< float64_t > get_eigenvalues()
Definition: PCA.cpp:244
virtual ~CPCA()
Definition: PCA.cpp:53
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
The class Features is the base class of all feature objects.
Definition: Features.h:62
Preprocessor PCACut performs principial component analysis on the input vectors and keeps only the n ...
Definition: PCA.h:48
EPCAMode
Definition: PCA.h:26
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
Definition: PCA.cpp:178
SGMatrix< float64_t > get_transformation_matrix()
Definition: PCA.cpp:239

SHOGUN Machine Learning Toolbox - Documentation