Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions

Question

What is the growth rate of GDP per capita?

Answered: 1 week ago