Changeset 1726
- Timestamp:
- Jan 15, 2009, 10:15:26 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/nni_test.cc
r1669 r1726 69 69 utility::Matrix weight(weight_stream); 70 70 utility::kNNI knni(data,weight,neighbours); 71 knni.estimate(); 71 unsigned int nonimputed=knni.estimate(); 72 if (!suite.equal(nonimputed,15)) { 73 suite.err() << "kNNI FAILED, unexpected number of non imputed rows" << std::endl; 74 suite.add(false); 75 } 72 76 std::ifstream control_stream(knni_result.c_str()); 73 77 utility::Matrix control(control_stream); … … 90 94 weight=utility::Matrix(weight_stream); 91 95 utility::WeNNI wenni(data,weight,neighbours); 92 wenni.estimate(); 96 nonimputed=wenni.estimate(); 97 if (!suite.equal(nonimputed,15)) { 98 suite.err() << "WeNNI FAILED, unexpected number of non imputed rows" << std::endl; 99 suite.add(false); 100 } 93 101 control_stream.open(wenni_result.c_str()); 94 102 control=utility::Matrix(control_stream); … … 110 118 weight=utility::Matrix(weight_stream); 111 119 utility::WeNNI wenni2(data,weight,neighbours); 112 wenni2.estimate(); 120 nonimputed=wenni2.estimate(); 121 if (!suite.equal(nonimputed,15)) { 122 suite.err() << "binary WeNNI FAILED, unexpected number of non imputed rows" 123 << std::endl; 124 suite.add(false); 125 } 113 126 control_stream.open(knni_result.c_str()); 114 127 control=utility::Matrix(control_stream); -
trunk/yat/utility/NNI.h
r1487 r1726 90 90 virtual ~NNI(void) {}; 91 91 92 /// 93 /// Function doing the imputation. 94 /// 95 /// @return number of rows not imputed 96 /// 92 /** 93 \brief Function doing the imputation. 94 95 The return value can be used as an indication of how well the 96 imputation worked. The return value should be zero if proper 97 pre-processing of data is done. An example of bad data is a 98 matrix with a column of zero weights, another is a 99 corresponding situation with a row with all weights zero. 100 101 \return The number of rows that have at least one value not 102 imputed. 103 */ 97 104 virtual unsigned int estimate(void)=0; 98 105 -
trunk/yat/utility/WeNNI.h
r1725 r1726 62 62 const unsigned int neighbours); 63 63 64 /// 65 /// Perform WeNNI on data in \a matrix with continuous uncertainty 66 /// weights in \a weight using \a neighbours for the new impute 67 /// value. 68 /// 64 /** 65 \brief Function doing WeNNI imputation. 66 67 Perform WeNNI on data in \a matrix with continuous uncertainty 68 weights in \a weight using \a neighbours for the new impute 69 value. 70 71 The return value can be used as an indication of how well the 72 imputation worked. The return value should be zero if proper 73 pre-processing of data is done. An example of bad data is a 74 matrix with a column of zero weights, another is a 75 corresponding situation with a row with all weights zero. 76 77 \return The number of rows that have at least one value not 78 imputed. 79 */ 69 80 unsigned int estimate(void); 70 81 -
trunk/yat/utility/kNNI.h
r1487 r1726 57 57 const unsigned int neighbours); 58 58 59 /// 60 /// Perform kNNI on data in \a matrix with binary uncertainty 61 /// weights in \a weight using \a neighbours for the new impute 62 /// value. 63 /// 59 /** 60 \brief Function doing kNNI imputation. 61 62 Perform kNNI on data in \a matrix with binary uncertainty 63 weights in \a weight using \a neighbours for the new impute 64 value. 65 66 The return value can be used as an indication of how well the 67 imputation worked. The return value should be zero if proper 68 pre-processing of data is done. An example of bad data is a 69 matrix with a column of zero weights, another is a 70 corresponding situation with a row with all weights zero. 71 72 \return The number of rows that have at least one value not 73 imputed. 74 */ 64 75 unsigned int estimate(void); 65 76
Note: See TracChangeset
for help on using the changeset viewer.