Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 preprocessed black and white images of the digits and Each feature
indicates how many pixels are black in a patch of x pixels.
Format: there is one row per image and one column per feature. The class labels are and The file
traintargets.csv includes the targets for the data in traininputs.csv
Implement knearest 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, crossvalidation, 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:
A graph that shows the average accuracy based on fold cross validation when varying the
number of neighbours from to
The best number of neighbours found by fold cross validation and its crossvalidation
accuracy.
The test accuracy based on the best number of neighbours
Step 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