Question: Origin: this data is a modified version of the Optical Recognition of Handwritten Digits Dataset from the UCI repository. It contains pre - processed black

Origin: this data is a modified version of the Optical Recognition of Handwritten Digits Dataset from the
UCI repository. It contains pre-processed black and white images of the digits 5 and 6. Each feature
indicates how many pixels are black in a patch of 4 x 4 pixels.
Format: there is one row per image and one column per feature. The class labels are 5 and 6. The file
train_targets.csv includes the targets for the data in train_inputs.csv.
Implement k-nearest neighbours. You are required to personally implement the core functionality of
KNN, which includes calculating distances between data points and determining predictions based on a
majority vote. Refrain from using external libraries for these specific tasks of the KNN algorithm.
However, you may utilize libraries for auxiliary tasks such as data loading, cross-validation, and other
supportive functions.
Feel free to run the Jupyter notebook on any machine or Google Colab. Google Colab is a free cloud
environment provided by Google that allows you to run Jupyter notebooks very easily. Python and all
necessary libraries are already installed.
Once you are done, run the Jupyter notebook entirely and save the following results:
1. A graph that shows the average accuracy based on 10-fold cross validation when varying the
number of neighbours from 1 to 30.
2. The best number of neighbours found by 10-fold cross validation and its cross-validation
accuracy.
3. The test accuracy based on the best number of neighbours

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!