Skip to content

Instantly share code, notes, and snippets.

Created Sep 5, 2020
What would you like to do?
from collections import Counter
# Create counter object to track the labels
counter = Counter(y[df_nn.index])
# Get most common label of all the nearest neighbors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment