Skip to content

Conversation

@iverbova
Copy link

@iverbova iverbova commented Jun 6, 2025

What changes are you trying to make?

Added completed code to assignment_1.ipynb, including:

  • Reading and inspecting the Wine dataset (rows, columns, data types)
  • Standardizing predictor variables
  • Splitting data into training and test sets using train_test_split
  • Performing hyperparameter tuning with GridSearchCV (1–50 neighbors, 10-fold CV)
  • Evaluating the model's accuracy on the test set

What did you learn from the changes you have made?

I learned how to prepare data for machine learning using KNN, including:

  • The importance of standardization for distance-based models
  • How to apply reproducible data splits using a random seed
  • How to use grid search and cross-validation to tune hyperparameters
  • How to evaluate classifier performance using accuracy

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

N/A


Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

Yes:

  • I initially got no output from the train/test split. I resolved this by using .describe() and .shape to confirm the data was correctly split.
  • Understanding why standardization and seed-setting were necessary took some effort, but was clarified by reviewing scikit-learn documentation and working through examples.

How were these changes tested?

All code cells were run in a local Jupyter Notebook environment and confirmed to:

  • Execute from top to bottom without errors
  • Correctly split and standardize data
  • Return the best n_neighbors from cross-validation
  • Evaluate accuracy on the test data

A reference to a related issue in your repository (if applicable)

N/A


Checklist

  • I can confirm that my changes are working as intended

@iverbova iverbova closed this Jun 6, 2025
@iverbova iverbova deleted the assignment-1 branch June 6, 2025 00:39
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.

1 participant