Skip to content

Assignment-1#1

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

Assignment-1#1
ItzelPolin wants to merge 1 commit into
mainfrom
assignment-1

Conversation

@ItzelPolin
Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown

@PatelVishakh PatelVishakh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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