SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
FisherLDA.h
浏览该文件的文档.
1 /*
2  * Copyright (c) 2014, Shogun Toolbox Foundation
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7 
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18 
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  * Written (W) 2014 Abhijeet Kislay
32  */
33 
34 #ifndef LDA_H_
35 #define LDA_H_
36 
37 #include <shogun/lib/config.h>
38 
39 #ifdef HAVE_EIGEN3
42 #include <shogun/labels/Labels.h>
45 
46 namespace shogun
47 {
48 
51  {
55  AUTO_FLDA = 10,
60  };
61 
94 {
95  public:
96 
103  CFisherLDA(EFLDAMethod method=AUTO_FLDA, float64_t thresh=0.01);
104 
106  virtual ~CFisherLDA();
107 
114  virtual bool init(CFeatures* features, CLabels* labels, int32_t num_dimensions=0);
115 
117  virtual void cleanup();
118 
125 
131 
135 
139 
143 
145  virtual const char* get_name() const {return "FisherLDA";}
146 
148  virtual EPreprocessorType get_type() const {return P_FISHERLDA;}
149 
150  protected:
151 
152  void init();
153 
157  int32_t m_num_dim;
161  int32_t m_method;
166 };
167 }
168 #endif //HAVE_EIGEN3
169 #endif //ifndef
the class DimensionReductionPreprocessor, a base class for preprocessors used to lower the dimensiona...
virtual const char * get_name() const
Definition: FisherLDA.h:145
EPreprocessorType
Definition: Preprocessor.h:32
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
Definition: FisherLDA.cpp:293
SGMatrix< float64_t > get_transformation_matrix()
Definition: FisherLDA.cpp:344
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
Definition: FisherLDA.cpp:330
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
Preprocessor FisherLDA attempts to model the difference between the classes of data by performing lin...
Definition: FisherLDA.h:93
virtual ~CFisherLDA()
Definition: FisherLDA.cpp:75
double float64_t
Definition: common.h:50
SGMatrix< float64_t > m_transformation_matrix
Definition: FisherLDA.h:155
CFisherLDA(EFLDAMethod method=AUTO_FLDA, float64_t thresh=0.01)
Definition: FisherLDA.cpp:51
virtual EPreprocessorType get_type() const
Definition: FisherLDA.h:148
SGVector< float64_t > m_mean_vector
Definition: FisherLDA.h:163
The class Features is the base class of all feature objects.
Definition: Features.h:68
SGVector< float64_t > m_eigenvalues_vector
Definition: FisherLDA.h:165
EFLDAMethod
Definition: FisherLDA.h:50
float64_t m_threshold
Definition: FisherLDA.h:159
SGVector< float64_t > get_mean()
Definition: FisherLDA.cpp:354
virtual void cleanup()
Definition: FisherLDA.cpp:286
SGVector< float64_t > get_eigenvalues()
Definition: FisherLDA.cpp:349

SHOGUN 机器学习工具包 - 项目文档