Skip to content

Instantly share code, notes, and snippets.

@ocoyawale
Forked from YohanObadia/knn_impute_example.py
Created January 28, 2018 01:52
Show Gist options
  • Save ocoyawale/88608fe484431726d8771245a3e04ad9 to your computer and use it in GitHub Desktop.
Save ocoyawale/88608fe484431726d8771245a3e04ad9 to your computer and use it in GitHub Desktop.
Example of use for the knn_impute function
knn_impute(target=df['Age'], attributes=df.drop(['Age', 'PassengerId'], 1),
aggregation_method="median", k_neighbors=10, numeric_distance='euclidean',
categorical_distance='hamming', missing_neighbors_threshold=0.8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment