knn_impute: kNN missing value imputation

View source: R/knn_impute_class.R

knn_imputeR Documentation

kNN missing value imputation

Description

k-nearest neighbour missing value imputation replaces missing values in the data with the average of a predefined number of the most similar neighbours for which the value is present

Usage

knn_impute(
  neighbours = 5,
  sample_max = 50,
  feature_max = 50,
  by = "features",
  ...
)

Arguments

neighbours

(numeric) The number of neighbours (k) to use for imputation. The default is 5.

sample_max

(numeric) The maximum percent missing values per sample. The default is 50.

feature_max

(numeric) The maximum percent missing values per feature. The default is 50.

by

(character) Impute using similar "samples" or "features". Default features. The default is "features".

...

Additional slots and values passed to struct_class.

Details

This object makes use of functionality from the following packages:

  • pmp

Value

A knn_impute object with the following output slots:

imputed (DatasetExperiment) A DatasetExperiment object containing the data where missing values have been imputed.

Inheritance

A knn_impute object inherits the following struct classes:

⁠[knn_impute]⁠ >> ⁠[model]⁠ >> ⁠[struct_class]⁠

References

Jankevics A, Lloyd GR, Weber RJM (????). pmp: Peak Matrix Processing and signal batch correction for metabolomics datasets. R package version 1.15.1.

Examples

M = knn_impute(
      neighbours = 5,
      feature_max = 50,
      sample_max = 50,
      by = "features")

M = knn_impute()

computational-metabolomics/structToolbox documentation built on July 5, 2024, 12:18 p.m.