Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello, below is the assignment details. It is suppose to be written in Python. Any help is appreciated. Thank You. Directions: For this assignment, you
Hello, below is the assignment details. It is suppose to be written in Python. Any help is appreciated. Thank You.
Directions: For this assignment, you need to build a KNN classifier from scratch. Below is a detailed instruction of what you may need to do. - Dataset Preparation You need to load the dataset using sklearn.datasets.load_digits. After loading the dataset, randomly shuffle the dataset to split the dataset to train/dev/test sets. - Use the 70% of data for the train set, 15% for the dev set, and 15% for the test set - You need to make sure that the labels and images are still matching after shuffling the data. - You may want to use the random shuffle function provided by Numpy. - KNN Development You need to write your own distance comparison function Use the train set as the training data, and use the dev set to determine the best K and best distance metric. - You may need to test multiple K values and distance metrics to select the optimal ones. - Test the Model After the optimal K value and distance metric are selected, test the model using the test setStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started