Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] weighted KNN imputation #318

Open
bvenn opened this issue Mar 7, 2024 · 0 comments
Open

[Feature Request] weighted KNN imputation #318

bvenn opened this issue Mar 7, 2024 · 0 comments
Assignees

Comments

@bvenn
Copy link
Member

bvenn commented Mar 7, 2024

FSharp.Stats already supports the KNN imputation via FSharp.Stats.ML.Impute.kNearestImpute. The current implementation takes the k nearest neighbors and computes the average of these at the index of interest. This average replaces the missing value of the incomplete data point. I suggest to make the following changes/additions:

  • rename the module to Imputation to be consistent within the library
  • add the possibility to define how a missing value is encoded (e.g., 0.0 or nan)
  • add an optional converter function that processes the distance measure. When using Pearson's correlation coefficient you determine the similarity rather the distance and therefore you have to take the reciprocal.
  • add a weighted version in which the averaging can be weighted according to the distance of the nearest neighbors
  • add proper documentation

Keywords

  • Local Least Squares
@bvenn bvenn self-assigned this Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant