yat
0.8.3pre
|
Weighted Nearest Neighbour Imputation. More...
#include <yat/utility/WeNNI.h>
Public Member Functions | |
WeNNI (const utility::Matrix &matrix, const utility::Matrix &weight, const unsigned int neighbours) | |
unsigned int | estimate (void) |
Function doing WeNNI imputation. | |
const utility::Matrix & | imputed_data_raw (void) const |
const utility::Matrix & | imputed_data (void) const |
const std::vector< size_t > & | not_imputed (void) const |
Protected Member Functions | |
std::vector< std::pair< size_t, double > > | calculate_distances (const size_t) const |
std::vector< size_t > | nearest_neighbours (const size_t, const std::vector< std::pair< size_t, double > > &) const |
Protected Attributes | |
const utility::Matrix & | data_ |
utility::Matrix | imputed_data_ |
unsigned int | neighbours_ |
std::vector< size_t > | not_imputed_ |
const utility::Matrix & | weight_ |
Weighted Nearest Neighbour Imputation.
WeNNI is a continuous weights generalization of the (binary weights) kNNI algorithm presented by Troyanskaya et al. A reference to this paper is found in the NNI document referred to in the NNI class documentation. The NNI document also describes WeNNI in depth.
theplu::yat::utility::WeNNI::WeNNI | ( | const utility::Matrix & | matrix, |
const utility::Matrix & | weight, | ||
const unsigned int | neighbours | ||
) |
Constructor
|
protectedinherited |
where C is the number of columns
|
virtual |
Function doing WeNNI imputation.
Perform WeNNI on data in matrix with continuous uncertainty weights in weight using neighbours for the new impute value.
The return value can be used as an indication of how well the imputation worked. The return value should be zero if proper pre-processing of data is done. An example of bad data is a matrix with a column of zero weights, another is a corresponding situation with a row with all weights zero.
Implements theplu::yat::utility::NNI.
|
inherited |
const utility::Matrix& theplu::yat::utility::WeNNI::imputed_data_raw | ( | void | ) | const |
|
protectedinherited |
Contributing nearest neighbours are added up to the user set number, and neighbours are disqualified if their element (column) weight is zero
|
inherited |
|
protectedinherited |
original data matrix
|
protectedinherited |
data after imputation
|
protectedinherited |
number of neighbor to use
|
protectedinherited |
which rows are not imputed due to lack of data
|
protectedinherited |
weight matrix