SHOGUN  4.2.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 
41 #include <shogun/labels/Labels.h>
43 
44 namespace shogun
45 {
46 
49  {
53  AUTO_FLDA = 10,
58  };
59 
92 {
93  public:
94 
101  CFisherLDA(EFLDAMethod method=AUTO_FLDA, float64_t thresh=0.01);
102 
104  virtual ~CFisherLDA();
105 
112  virtual bool fit(CFeatures* features, CLabels* labels, int32_t num_dimensions=0);
113 
115  virtual void cleanup();
116 
123 
129 
133 
137 
141 
143  virtual const char* get_name() const {return "FisherLDA";}
144 
146  virtual EPreprocessorType get_type() const {return P_FISHERLDA;}
147 
148  private:
149 
150  void initialize_parameters();
151 
152  protected:
153 
154 
158  int32_t m_num_dim;
162  int32_t m_method;
167 };
168 }
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:143
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 bool fit(CFeatures *features, CLabels *labels, int32_t num_dimensions=0)
Definition: FisherLDA.cpp:79
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:91
virtual ~CFisherLDA()
Definition: FisherLDA.cpp:75
double float64_t
Definition: common.h:50
SGMatrix< float64_t > m_transformation_matrix
Definition: FisherLDA.h:156
CFisherLDA(EFLDAMethod method=AUTO_FLDA, float64_t thresh=0.01)
Definition: FisherLDA.cpp:51
virtual EPreprocessorType get_type() const
Definition: FisherLDA.h:146
SGVector< float64_t > m_mean_vector
Definition: FisherLDA.h:164
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:166
EFLDAMethod
Definition: FisherLDA.h:48
float64_t m_threshold
Definition: FisherLDA.h:160
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 Machine Learning Toolbox - Documentation