00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 1999-2008 Soeren Sonnenburg 00008 * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00009 */ 00010 00011 #ifndef _LDA_H___ 00012 #define _LDA_H___ 00013 00014 #include "lib/common.h" 00015 00016 #ifdef HAVE_LAPACK 00017 #include "features/Features.h" 00018 #include "classifier/LinearClassifier.h" 00019 00021 class CLDA : public CLinearClassifier 00022 { 00023 public: 00028 CLDA(DREAL gamma=0); 00029 00036 CLDA(DREAL gamma, CRealFeatures* traindat, CLabels* trainlab); 00037 virtual ~CLDA(); 00038 00043 inline void set_gamma(DREAL gamma) 00044 { 00045 m_gamma=gamma; 00046 } 00047 00052 inline DREAL get_gamma() 00053 { 00054 return m_gamma; 00055 } 00056 00061 virtual bool train(); 00062 00067 inline virtual EClassifierType get_classifier_type() 00068 { 00069 return CT_LDA; 00070 } 00071 00072 protected: 00074 DREAL m_gamma; 00075 }; 00076 #endif 00077 #endif