yat  0.10.4pre
NNI.h
1 #ifndef _theplu_yat_utility_nni_
2 #define _theplu_yat_utility_nni_
3 
4 // $Id: NNI.h 2119 2009-12-12 23:11:43Z peter $
5 
6 /*
7  Copyright (C) 2004 Jari Häkkinen
8  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
9  Copyright (C) 2009 Jari Häkkinen
10 
11  This file is part of the yat library, http://dev.thep.lu.se/yat
12 
13  The yat library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License as
15  published by the Free Software Foundation; either version 3 of the
16  License, or (at your option) any later version.
17 
18  The yat library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with yat. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #include "Matrix.h"
28 
29 #include <utility>
30 #include <vector>
31 
32 namespace theplu {
33 namespace yat {
34 namespace utility {
35 
79  class NNI
80  {
81  public:
82 
87  NNI(const utility::Matrix& matrix,const utility::Matrix& weight,
88  const unsigned int neighbours);
89 
90  virtual ~NNI(void) {};
91 
104  virtual unsigned int estimate(void)=0;
105 
109  const utility::Matrix& imputed_data(void) const;
110 
114  const std::vector<size_t>& not_imputed(void) const;
115 
116  protected:
121  std::vector<std::pair<size_t,double> >
122  calculate_distances(const size_t) const;
126  std::vector<size_t>
127  nearest_neighbours(const size_t,
128  const std::vector<std::pair<size_t,double> >&) const;
133 
138 
142  unsigned int neighbours_;
143 
147  std::vector<size_t> not_imputed_;
148 
153  };
154 
155 }}} // of namespace utility, yat, and theplu
156 
157 #endif

Generated on Mon Nov 11 2013 09:41:44 for yat by  doxygen 1.8.1