source: trunk/src/kNNI.h @ 228

Last change on this file since 228 was 228, checked in by Peter, 18 years ago

moved estimation from constructor, added function telling which rows were not imputed (due too many missing values).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1001 bytes
Line 
1// $Id: kNNI.h 228 2005-02-01 14:06:51Z peter $
2
3#ifndef _theplu_cpptools_knni_
4#define _theplu_cpptools_knni_
5
6#include "NNI.h"
7
8#include <iostream>
9#include <vector>
10
11namespace theplu {
12namespace cpptools {
13
14  ///
15  /// kNNI is the binary weight implementation of NNI. This follows
16  /// the work done by Troyanskaya et al. cited in the NNI document
17  /// referred to in the NNI class documentation.
18  ///
19  /// This is a special case of the WeNNI, but is maintained since it
20  /// is faster than the more general WeNNI.
21  ///
22  /// @see NNI and WeNNI
23  ///
24  class kNNI : public NNI
25  {
26  public:
27    ///
28    /// Constructor
29    ///
30    kNNI(const gslapi::matrix& matrix,const gslapi::matrix& weight,
31         const u_int neighbours);
32
33    ///
34    /// Perform kNNI on data in \a matrix with binary uncertainty
35    /// weights in \a weight using \a neighbours for the new impute
36    /// value.
37    ///
38    size_t estimate(void);
39
40  private:
41    vector<u_int> mv_rows_; // index to rows that have values to estimate
42  };
43
44}} // of namespace cpptools and namespace theplu
45
46#endif
Note: See TracBrowser for help on using the repository browser.