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 Gunnar Raetsch 00008 * Written (W) 1999-2008 Soeren Sonnenburg 00009 * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society 00010 */ 00011 00012 #ifndef _CPCACUT__H__ 00013 #define _CPCACUT__H__ 00014 00015 #include "lib/config.h" 00016 00017 #ifdef HAVE_LAPACK 00018 00019 #include <stdio.h> 00020 00021 #include "preproc/SimplePreProc.h" 00022 #include "features/Features.h" 00023 #include "lib/common.h" 00024 00025 namespace shogun 00026 { 00039 #define IGNORE_IN_CLASSLIST 00040 IGNORE_IN_CLASSLIST class CPCACut : public CSimplePreProc<float64_t> 00041 { 00042 public: 00048 CPCACut(int32_t do_whitening=0, float64_t thresh=1e-6); 00049 virtual ~CPCACut(); 00050 00052 virtual bool init(CFeatures* f); 00054 virtual void cleanup(); 00055 00059 virtual float64_t* apply_to_feature_matrix(CFeatures* f); 00060 00063 virtual float64_t* apply_to_feature_vector(float64_t* f, int32_t &len); 00064 00066 inline virtual const char* get_name() { return "PCACut"; } 00067 00068 protected: 00070 double* T ; 00072 int32_t num_dim; 00074 int32_t num_old_dim; 00076 float64_t *mean ; 00077 00079 bool initialized; 00080 00082 int32_t do_whitening; 00084 float64_t thresh; 00085 }; 00086 } 00087 #endif 00088 #endif