Question: Machine Learning (K-Nearest Neighbor Classification using Python via Jupyter Notebook) Q) Obtain the CIFAR-10 dataset (Python version), which is commonly used for image classification and

Machine Learning (K-Nearest Neighbor Classification using Python via Jupyter Notebook)

Q) Obtain the CIFAR-10 dataset (Python version), which is commonly used for image classification and load it using Tensorflow (sample code given):

import tensorflow as tf (train_x, train_y), (test_x,test_y)=tf.keras.datasets.cifar10.load_data() 

Now, using this loaded dataset, implement the K-nearest neighbor classifier. With the help of r - fold cross validation (using r = 5), approximate the optimal value of K (from K=1,3,5 till 21). Also, by creating a confusion matrix, provide the classification result along with the training error and testing error for the optimal value of K. Further, plot the precision recall curve for the optimal K value, across all classes.

Note: The file to be provided are - (i) a python file (with the programming part), (ii) an output file and also (iii) a screenshot of the output. This should be implemented in Python via Jupyter Notebook. Tensorflow can be used to load the CIFAR-10 dataset as mentioned above.

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!