SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FisherLDA.h
Go to the documentation of this file.
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>
44 
45 namespace shogun
46 {
47 
50  {
54  AUTO_FLDA = 10,
59  };
60 
93 {
94  public:
95 
102  CFisherLDA(EFLDAMethod method=AUTO_FLDA, float64_t thresh=0.01);
103 
105  virtual ~CFisherLDA();
106 
113  virtual bool fit(CFeatures* features, CLabels* labels, int32_t num_dimensions=0);
114 
116  virtual void cleanup();
117 
124 
130 
134 
138 
142 
144  virtual const char* get_name() const {return "FisherLDA";}
145 
147  virtual EPreprocessorType get_type() const {return P_FISHERLDA;}
148 
149  private:
150 
151  void initialize_parameters();
152 
153  protected:
154 
155 
159  int32_t m_num_dim;
163  int32_t m_method;
168 };
169 }
170 #endif //HAVE_EIGEN3
171 #endif //ifndef
the class DimensionReductionPreprocessor, a base class for preprocessors used to lower the dimensiona...
virtual const char * get_name() const
Definition: FisherLDA.h:144
EPreprocessorType
Definition: Preprocessor.h:32
virtual SGMatrix< float64_t > apply_to_feature_matrix(CFeatures *features)
Definition: FisherLDA.cpp:294
SGMatrix< float64_t > get_transformation_matrix()
Definition: FisherLDA.cpp:345
virtual bool fit(CFeatures *features, CLabels *labels, int32_t num_dimensions=0)
Definition: FisherLDA.cpp:80
virtual SGVector< float64_t > apply_to_feature_vector(SGVector< float64_t > vector)
Definition: FisherLDA.cpp:331
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:92
virtual ~CFisherLDA()
Definition: FisherLDA.cpp:76
double float64_t
Definition: common.h:50
SGMatrix< float64_t > m_transformation_matrix
Definition: FisherLDA.h:157
CFisherLDA(EFLDAMethod method=AUTO_FLDA, float64_t thresh=0.01)
Definition: FisherLDA.cpp:52
virtual EPreprocessorType get_type() const
Definition: FisherLDA.h:147
SGVector< float64_t > m_mean_vector
Definition: FisherLDA.h:165
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
SGVector< float64_t > m_eigenvalues_vector
Definition: FisherLDA.h:167
EFLDAMethod
Definition: FisherLDA.h:49
float64_t m_threshold
Definition: FisherLDA.h:161
SGVector< float64_t > get_mean()
Definition: FisherLDA.cpp:355
virtual void cleanup()
Definition: FisherLDA.cpp:287
SGVector< float64_t > get_eigenvalues()
Definition: FisherLDA.cpp:350

SHOGUN Machine Learning Toolbox - Documentation