Skip to content

Instantly share code, notes, and snippets.

@joao-timescale
Created November 26, 2017 12:40
Show Gist options
  • Save joao-timescale/a0bdc1913dc08a1e6ff0618db267cddd to your computer and use it in GitHub Desktop.
Save joao-timescale/a0bdc1913dc08a1e6ff0618db267cddd to your computer and use it in GitHub Desktop.
KNN training
classifier = KNearestNeighbors(k=5)
# Train the classifier
classifier.fit(train_data, train_data_labels)
# Obtain the predictions based on the training data
prediction = classifier.predict(test_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment