-
-
Save sazio/6ae18b9038fc612c456dd0d9d5865cfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from sklearn.impute import KNNImputer | |
X = [[1, 2, np.nan], [3, 4, 3], [np.nan, 6, 5], [8, 8, 7]] | |
imputer = KNNImputer(n_neighbors=2, weights="uniform") | |
print(X) | |
print(imputer.fit_transform(X)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment