69 |
11 Feb 06 |
jari |
// $Id$ |
69 |
11 Feb 06 |
jari |
2 |
|
95 |
05 Apr 06 |
jari |
3 |
/* |
95 |
05 Apr 06 |
jari |
Copyright (C) 2004 Jari Häkkinen |
95 |
05 Apr 06 |
jari |
Copyright (C) 2005 Peter Johansson |
95 |
05 Apr 06 |
jari |
Copyright (C) 2006 Jari Häkkinen |
95 |
05 Apr 06 |
jari |
7 |
|
95 |
05 Apr 06 |
jari |
This file is part of the thep c++ tools library, |
95 |
05 Apr 06 |
jari |
http://lev.thep.lu.se/trac/c++_tools |
95 |
05 Apr 06 |
jari |
10 |
|
95 |
05 Apr 06 |
jari |
The c++ tools library is free software; you can redistribute it |
95 |
05 Apr 06 |
jari |
and/or modify it under the terms of the GNU General Public License |
824 |
26 Nov 08 |
jari |
as published by the Free Software Foundation; either version 3 of |
95 |
05 Apr 06 |
jari |
the License, or (at your option) any later version. |
95 |
05 Apr 06 |
jari |
15 |
|
95 |
05 Apr 06 |
jari |
The c++ tools library is distributed in the hope that it will be |
95 |
05 Apr 06 |
jari |
useful, but WITHOUT ANY WARRANTY; without even the implied warranty |
95 |
05 Apr 06 |
jari |
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
95 |
05 Apr 06 |
jari |
General Public License for more details. |
95 |
05 Apr 06 |
jari |
20 |
|
95 |
05 Apr 06 |
jari |
You should have received a copy of the GNU General Public License |
824 |
26 Nov 08 |
jari |
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_wenni_ |
69 |
11 Feb 06 |
jari |
26 |
#define _theplu_utility_wenni_ |
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 <c++_tools/gslapi/matrix.h> |
69 |
11 Feb 06 |
jari |
31 |
|
69 |
11 Feb 06 |
jari |
32 |
#include <iostream> |
69 |
11 Feb 06 |
jari |
33 |
|
69 |
11 Feb 06 |
jari |
34 |
|
69 |
11 Feb 06 |
jari |
35 |
|
69 |
11 Feb 06 |
jari |
36 |
namespace theplu { |
69 |
11 Feb 06 |
jari |
37 |
namespace utility { |
69 |
11 Feb 06 |
jari |
38 |
|
69 |
11 Feb 06 |
jari |
39 |
/// |
69 |
11 Feb 06 |
jari |
/// WeNNI is a continuous weights generalization of the (binary |
69 |
11 Feb 06 |
jari |
/// weights) kNNI algorithm presented by Troyanskaya et al. A |
69 |
11 Feb 06 |
jari |
/// reference to this paper is found in the NNI document referred to |
69 |
11 Feb 06 |
jari |
/// in the NNI class documentation. The NNI document also describes |
69 |
11 Feb 06 |
jari |
/// WeNNI in depth. |
69 |
11 Feb 06 |
jari |
45 |
/// |
69 |
11 Feb 06 |
jari |
/// @see NNI and kNNI |
69 |
11 Feb 06 |
jari |
47 |
/// |
69 |
11 Feb 06 |
jari |
48 |
class WeNNI : public NNI |
69 |
11 Feb 06 |
jari |
49 |
{ |
69 |
11 Feb 06 |
jari |
50 |
public: |
69 |
11 Feb 06 |
jari |
51 |
/// |
69 |
11 Feb 06 |
jari |
/// Constructor |
69 |
11 Feb 06 |
jari |
53 |
/// |
69 |
11 Feb 06 |
jari |
54 |
WeNNI(const gslapi::matrix& matrix,const gslapi::matrix& weight, |
819 |
24 Nov 08 |
jari |
55 |
const unsigned int neighbours); |
69 |
11 Feb 06 |
jari |
56 |
|
69 |
11 Feb 06 |
jari |
57 |
/// |
69 |
11 Feb 06 |
jari |
/// Perform WeNNI on data in \a matrix with continuous uncertainty |
69 |
11 Feb 06 |
jari |
/// weights in \a weight using \a neighbours for the new impute |
69 |
11 Feb 06 |
jari |
/// value. |
69 |
11 Feb 06 |
jari |
61 |
/// |
819 |
24 Nov 08 |
jari |
62 |
unsigned int estimate(void); |
69 |
11 Feb 06 |
jari |
63 |
|
69 |
11 Feb 06 |
jari |
64 |
/// |
69 |
11 Feb 06 |
jari |
/// @return A const reference to imputed_data_raw. |
69 |
11 Feb 06 |
jari |
66 |
/// |
69 |
11 Feb 06 |
jari |
67 |
const gslapi::matrix& imputed_data_raw(void) const |
69 |
11 Feb 06 |
jari |
68 |
{ return imputed_data_raw_; } |
69 |
11 Feb 06 |
jari |
69 |
|
69 |
11 Feb 06 |
jari |
70 |
|
69 |
11 Feb 06 |
jari |
71 |
|
69 |
11 Feb 06 |
jari |
72 |
private: |
69 |
11 Feb 06 |
jari |
73 |
|
69 |
11 Feb 06 |
jari |
74 |
gslapi::matrix imputed_data_raw_; |
69 |
11 Feb 06 |
jari |
75 |
}; |
69 |
11 Feb 06 |
jari |
76 |
|
69 |
11 Feb 06 |
jari |
77 |
}} // of namespace utility and namespace theplu |
69 |
11 Feb 06 |
jari |
78 |
|
69 |
11 Feb 06 |
jari |
79 |
#endif |