Skip to content

Uploading LCR assignment 1.#1

Open
abeerkhe wants to merge 1 commit into
mainfrom
assignment-1
Open

Uploading LCR assignment 1.#1
abeerkhe wants to merge 1 commit into
mainfrom
assignment-1

Conversation

@abeerkhe
Copy link
Copy Markdown
Owner

@abeerkhe abeerkhe commented Sep 8, 2025

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

Create and test a KNN model for the class of wine from the load_wine dataset.

What did you learn from the changes you have made?

How to understand pandas dataframes, fit a model, use the model to predict values, and test the accuracy of that model.

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?

A couple challenges:

  1. The first time around I accidentally fitted the model to the dataframe altogether (‘wine_df‘) and not the training data (‘wine_train‘). I caught this while reviewing material during the final question and had to go through and update the correct code.

  2. During question 4, I was getting an indexing error which was because my code to create the predicted values (‘wine_test["predicted"]‘) was using incorrect indexing which tried to use the ‘wine_test[class]‘ column. This was because the ‘wine_test.iloc[:, :-2])‘ code originally used ‘-1‘ instead, which only excluded the last column--the newly-created ‘wine_test["predicted"]‘ column.

How were these changes tested?

When the error codes disappeared. :)

That being said, I'm still not fully confident with the 100% match for Question 4 which would be related to training vs testing data. I'm not familiar enough with wine or the dataset to know if the dependent variable, ‘class‘, can be fully explained by our independent variables.

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

N/A - I created and navigated to the correct branch before starting the assignment this time.

Checklist

  • [ x ] I can confirm that my changes are working as intended

@efantinatti
Copy link
Copy Markdown

Hi Abeer

PR Feedback Report

Student: Abeer
GitHub Username: @abeerkhe
PR Number: 1
Branch: assignment-1
Status: COMPLETE
PR URL: https://www.github.com/abeerkhe/lcr/pull/1

What You Did Well (Hits)

The student correctly inspected the data, scaled the data, set up the parameter grid for the grid search, and used 10-fold cross-validation. The best hyperparameter was correctly identified as 8.

Areas for Improvement (Errors)

The accuracy score in question 4 is 0.944, which is slightly off from the expected 0.947.

Advice and Recommendations

Your submission is very close to complete. Double check the accuracy score in question 4. Make sure you are using the correct test data for the prediction. Keep up the great work.

Overall Assessment

Good

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.

2 participants