plugins/base1/se.lu.thep.wenni/trunk/lib/c++_tools/utility/kNNI.h

Code
Comments
Other
Rev Date Author Line
69 11 Feb 06 jari 1 // $Id$
69 11 Feb 06 jari 2
95 05 Apr 06 jari 3 /*
95 05 Apr 06 jari 4   Copyright (C) 2004 Jari Häkkinen
95 05 Apr 06 jari 5   Copyright (C) 2005 Jari Häkkinen, Peter Johansson
95 05 Apr 06 jari 6   Copyright (C) 2006 Jari Häkkinen
95 05 Apr 06 jari 7
95 05 Apr 06 jari 8   This file is part of the thep c++ tools library,
95 05 Apr 06 jari 9                                 http://lev.thep.lu.se/trac/c++_tools
95 05 Apr 06 jari 10
95 05 Apr 06 jari 11   The c++ tools library is free software; you can redistribute it
95 05 Apr 06 jari 12   and/or modify it under the terms of the GNU General Public License
824 26 Nov 08 jari 13   as published by the Free Software Foundation; either version 3 of
95 05 Apr 06 jari 14   the License, or (at your option) any later version.
95 05 Apr 06 jari 15
95 05 Apr 06 jari 16   The c++ tools library is distributed in the hope that it will be
95 05 Apr 06 jari 17   useful, but WITHOUT ANY WARRANTY; without even the implied warranty
95 05 Apr 06 jari 18   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
95 05 Apr 06 jari 19   General Public License for more details.
95 05 Apr 06 jari 20
95 05 Apr 06 jari 21   You should have received a copy of the GNU General Public License
824 26 Nov 08 jari 22   along with WeNNI. If not, see <http://www.gnu.org/licenses/>.
95 05 Apr 06 jari 23 */
95 05 Apr 06 jari 24
69 11 Feb 06 jari 25 #ifndef _theplu_utility_knni_
69 11 Feb 06 jari 26 #define _theplu_utility_knni_ 
69 11 Feb 06 jari 27
69 11 Feb 06 jari 28 #include <c++_tools/utility/NNI.h>
69 11 Feb 06 jari 29
69 11 Feb 06 jari 30 #include <iostream>
69 11 Feb 06 jari 31 #include <vector>
69 11 Feb 06 jari 32
69 11 Feb 06 jari 33 namespace theplu {
69 11 Feb 06 jari 34 namespace utility {
69 11 Feb 06 jari 35
69 11 Feb 06 jari 36   ///
69 11 Feb 06 jari 37   /// kNNI is the binary weight implementation of NNI. This follows
69 11 Feb 06 jari 38   /// the work done by Troyanskaya et al. cited in the NNI document
69 11 Feb 06 jari 39   /// referred to in the NNI class documentation.
69 11 Feb 06 jari 40   ///
69 11 Feb 06 jari 41   /// This is a special case of the WeNNI, but is maintained since it
69 11 Feb 06 jari 42   /// is faster than the more general WeNNI.
69 11 Feb 06 jari 43   ///
69 11 Feb 06 jari 44   /// @see NNI and WeNNI
69 11 Feb 06 jari 45   ///
69 11 Feb 06 jari 46   class kNNI : public NNI
69 11 Feb 06 jari 47   {
69 11 Feb 06 jari 48   public:
69 11 Feb 06 jari 49     ///
69 11 Feb 06 jari 50     /// Constructor
69 11 Feb 06 jari 51     ///
69 11 Feb 06 jari 52     kNNI(const gslapi::matrix& matrix,const gslapi::matrix& weight,
819 24 Nov 08 jari 53          const unsigned int neighbours);
69 11 Feb 06 jari 54
69 11 Feb 06 jari 55     ///
69 11 Feb 06 jari 56     /// Perform kNNI on data in \a matrix with binary uncertainty
69 11 Feb 06 jari 57     /// weights in \a weight using \a neighbours for the new impute
69 11 Feb 06 jari 58     /// value.
69 11 Feb 06 jari 59     ///
819 24 Nov 08 jari 60     unsigned int estimate(void);
69 11 Feb 06 jari 61
69 11 Feb 06 jari 62   private:
819 24 Nov 08 jari 63     std::vector<unsigned int> mv_rows_;  // index to rows that have values to estimate
69 11 Feb 06 jari 64   };
69 11 Feb 06 jari 65
69 11 Feb 06 jari 66 }} // of namespace utility and namespace theplu
69 11 Feb 06 jari 67
69 11 Feb 06 jari 68 #endif