Assignment-1#1
Conversation
PatelVishakh
left a comment
There was a problem hiding this comment.
Assignment 1: Complete. Great work!
Suggested Changes:
Q1)
When answering questions rather then commenting in after manually reading the output, should automate it. for eg.
Number of observations (rows)
num_observations = wine_df.shape[0]
print(f"Number of observations: {num_observations}")
Q1)III) The type of variable is categorical. In a data science setting, this question is asking whether the variable is continuous or categorial(integer, ordinal are other options).
Q2)II) We did not standardize the response variable Class because it is categorical and standardization is not meaningful for non-numeric labels, also we do not standardize the response variable, because that is the quantity of interest and we would have to rescale our predictions make them usable.
ull Request Description
This PR completes Assignment 1, which focuses on implementing a K-Nearest Neighbors (KNN) classifier using the Wine dataset.
Summary of work completed:
Loaded and inspected the Wine dataset
Identified response and predictor variables
Standardized predictor variables using StandardScaler
Split the data into training (75%) and testing (25%) sets
Tuned the n_neighbors hyperparameter using 10-fold cross-validation (GridSearchCV)
Fit the final KNN model using the optimal number of neighbors
Evaluated model performance on the test set using accuracy
Results:
Best number of neighbors selected via cross-validation
Final test accuracy: 0.9333