PruneVarSubMean.h

Go to the documentation of this file.
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-2008 Fraunhofer Institute FIRST and Max-Planck-Society
00010  */
00011 
00012 #ifndef _CPRUNE_VAR_SUB_MEAN__H__
00013 #define _CPRUNE_VAR_SUB_MEAN__H__
00014 
00015 #include "preproc/SimplePreProc.h"
00016 #include "features/Features.h"
00017 #include "features/RealFeatures.h"
00018 #include "lib/common.h"
00019 
00020 #include <stdio.h>
00021 
00023 class CPruneVarSubMean : public CSimplePreProc<DREAL>
00024 {
00025     public:
00030         CPruneVarSubMean(bool divide=true);
00031         virtual ~CPruneVarSubMean();
00032 
00034         virtual bool init(CFeatures* f);
00035 
00037         virtual bool load_init_data(FILE* src);
00039         virtual bool save_init_data(FILE* dst);
00040 
00042         virtual void cleanup();
00043 
00047         virtual DREAL* apply_to_feature_matrix(CFeatures* f);
00048 
00051         virtual DREAL* apply_to_feature_vector(DREAL* f, INT &len);
00052 
00053     protected:
00055         INT* idx;
00057         DREAL* mean;
00059         DREAL* std;
00061         INT num_idx;
00063         bool divide_by_std;
00064 
00066         bool initialized;
00067 };
00068 #endif

SHOGUN Machine Learning Toolbox - Documentation