00001 #ifndef _theplu_yat_classifier_featureselector_ 00002 #define _theplu_yat_classifier_featureselector_ 00003 00004 // $Id: FeatureSelector.h 2119 2009-12-12 23:11:43Z peter $ 00005 00006 /* 00007 Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 00008 00009 This file is part of the yat library, http://dev.thep.lu.se/yat 00010 00011 The yat library is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License as 00013 published by the Free Software Foundation; either version 3 of the 00014 License, or (at your option) any later version. 00015 00016 The yat library is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 General Public License for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with yat. If not, see <http://www.gnu.org/licenses/>. 00023 */ 00024 00025 #include "yat/utility/Index.h" 00026 00027 #include <list> 00028 00029 namespace theplu { 00030 namespace yat { 00031 namespace classifier { 00032 class MatrixLookup; 00033 class MatrixLookupWeighted; 00034 class Target; 00035 00039 class FeatureSelector 00040 { 00041 public: 00045 FeatureSelector(size_t N, size_t skip=0); 00046 00050 virtual ~FeatureSelector(void); 00051 00055 const MatrixLookup get(const MatrixLookup& data); 00056 00060 const MatrixLookupWeighted get(const MatrixLookupWeighted& data); 00061 00065 const utility::Index features(void) const; 00066 00070 virtual void update(const MatrixLookup& matrix, const Target& target)=0; 00071 00075 virtual void update(const MatrixLookupWeighted& matrix, 00076 const Target& target)=0; 00077 00078 protected: 00082 utility::Index features_; 00083 00087 size_t first_; 00088 00092 size_t N_; 00093 00094 private: 00095 00096 }; 00097 00098 }}} // of namespace classifier, yat, and theplu 00099 00100 #endif