在MATLAB的Bioinformtics工具包内,提供了多维缺失数据的插补命令,使用Nearest Neighbour算法。将缺失的数据用NaN表示,然后将含有缺失数据的矩阵作为参数传给knnimpute命令,得到插补之后的数据。
具体命令介绍如下:
knnimpute(Data) replaces NaNs in Data with the corresponding value from the nearest-neighbor column. The nearest-neighbor column is the closest column in Euclidean distance. If the corresponding value from the nearest-neighbor column is also NaN, the next nearest column is used.
转载请注明:王杭州的个人网页 » MATLAB中缺失数据的插补命令:knnimpute