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

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

Q) Obtain the CIFAR-10 dataset (Python version), which is commonly used for image classification and load it using Tensorflow (note that considering resource constraints, you may take 15,000 - 20,000 training samples & 2,000 test samples from the dataset. If you can support more training and test samples, go for it but otherwise stick to the limits mentioned here).

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). Please note that KNN classifier and r - fold cross validation must be implemented by yourself. You can use a built in KNN classifier only to verify / compare accuracy. Then, 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) output image files like graphs and also (iii) a screenshot of the output from Colab / Jupyter Notebook. This should be implemented in Python via Jupyter Notebook or Google Colaboratory. Tensorflow must be used to load the CIFAR-10 dataset as mentioned with above requirements.

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!