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

feat: add k-nearest neighbor machine learning algo #224

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Cyntwikip
Copy link

@Cyntwikip Cyntwikip commented Oct 31, 2021

Description

This is my implementation of the k-nearest neighbors machine learning algorithm.

Sample Usage:

clf = KNeighborsClassifier(n_neighbors=3, p=2, n_jobs=-1) # instantiate model
clf.fit(X_train, y_train) # train the model
score = clf.score(X_test, y_test) # does prediction and score evaluation in 1 line
print(f"Test Set Score: {score:.2%}")

Checklist:

  • Code contain Problem statement, examples test cases.
  • My code follows the style guidelines(Clean Code) of this project
  • I have performed a self-review of my own code
  • Explained Detailed approach of Solution
  • I have commented on my code, particularly in hard-to-understand areas
  • Performed Time complexity analysis of the algorithm used in code

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

Successfully merging this pull request may close these issues.

None yet

1 participant