source: trunk/yat/utility/kNNI.h @ 1271

Last change on this file since 1271 was 1271, checked in by Peter, 13 years ago

replaced u_int with unsigned int or size_t

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1#ifndef _theplu_yat_utility_knni_
2#define _theplu_yat_utility_knni_
3
4// $Id: kNNI.h 1271 2008-04-09 16:11:07Z peter $
5
6/*
7  Copyright (C) 2004 Jari Häkkinen
8  Copyright (C) 2005 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2006 Jari Häkkinen
10  Copyright (C) 2007 Peter Johansson
11
12  This file is part of the yat library, http://trac.thep.lu.se/yat
13
14  The yat library is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License as
16  published by the Free Software Foundation; either version 2 of the
17  License, or (at your option) any later version.
18
19  The yat library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23
24  You should have received a copy of the GNU General Public License
25  along with this program; if not, write to the Free Software
26  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27  02111-1307, USA.
28*/
29
30#include "NNI.h"
31
32#include <iostream>
33#include <vector>
34
35namespace theplu {
36namespace yat {
37namespace utility {
38
39  ///
40  /// @brief kNNimpute
41  ///
42  /// kNNI is the binary weight implementation of NNI. This follows
43  /// the work done by Troyanskaya et al. cited in the NNI document
44  /// referred to in the NNI class documentation.
45  ///
46  /// This is a special case of the WeNNI, but is maintained since it
47  /// is faster than the more general WeNNI.
48  ///
49  /// @see NNI and WeNNI
50  ///
51  class kNNI : public NNI
52  {
53  public:
54    ///
55    /// Constructor
56    ///
57    kNNI(const utility::Matrix& matrix,const utility::Matrix& weight,
58         const unsigned int neighbours);
59
60    ///
61    /// Perform kNNI on data in \a matrix with binary uncertainty
62    /// weights in \a weight using \a neighbours for the new impute
63    /// value.
64    ///
65    unsigned int estimate(void);
66
67  private:
68    std::vector<size_t> mv_rows_; // index to rows that have values to estimate
69  };
70
71}}} // of namespace utility, yat, and theplu
72
73#endif
Note: See TracBrowser for help on using the repository browser.