Merged
Conversation
anjali-deshpande-hub
approved these changes
Nov 27, 2025
anjali-deshpande-hub
left a comment
There was a problem hiding this comment.
Well done!
Just one comment: Instead of hardcoding n_neighbors=7, you can use wine_tune_grid.best_params_['n_neighbors'] to get the best neighbour.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes are you trying to make? (e.g. adding or removing code, refactoring existing code, adding reports)
Adding text and Python code to answer Assignment-1 KNN classifier questions in a Jupyter notebook.
What did you learn from the changes you have made?
I learned that the prediction variable used in a KNN classifier can have more than two categorical values; that the prediction value can be stored in a separate scalar array; and that the accuracy function used to evaluate the KNN model must differ from the KNN score function we were taught in class.
Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?
No, I referred to Hannah's question and Dmytro's possible solution to understand how to split the train/test split when the predictor variables and the response variable are handled separately to create a series of X, y parameters for modelling. Also searched: https://scikit-learn.org
Were there any challenges? If so, what issue(s) did you face? How did you overcome it?
How were these changes tested?
In Jupyter, I saved my code as I went, and when I ran into a problem, I tested my solution for the reasonableness of the answer and/or printed the resulting array. I frequently restarted and reran the entire code.
A reference to a related issue in your repository (if applicable)
Checklist