SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LDA.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-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _LDA_H___
12 #define _LDA_H___
13 
14 #include <shogun/lib/config.h>
15 
16 #ifdef HAVE_LAPACK
17 #include <shogun/lib/common.h>
21 
22 namespace shogun
23 {
24  template <class ST> class CSimpleFeatures;
52 class CLDA : public CLinearMachine
53 {
54  public:
59  CLDA(float64_t gamma=0);
60 
67  CLDA(float64_t gamma, CSimpleFeatures<float64_t>* traindat, CLabels* trainlab);
68  virtual ~CLDA();
69 
74  inline void set_gamma(float64_t gamma)
75  {
76  m_gamma=gamma;
77  }
78 
84  {
85  return m_gamma;
86  }
87 
93  {
94  return CT_LDA;
95  }
96 
101  virtual inline void set_features(CDotFeatures* feat)
102  {
103  if (feat->get_feature_class() != C_SIMPLE ||
104  feat->get_feature_type() != F_DREAL)
105  SG_ERROR("LDA requires SIMPLE REAL valued features\n");
106 
108  }
109 
111  inline virtual const char* get_name() const { return "LDA"; }
112 
113  protected:
122  virtual bool train_machine(CFeatures* data=NULL);
123 
124  protected:
127 };
128 }
129 #endif
130 #endif

SHOGUN Machine Learning Toolbox - Documentation