Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab Coding for MNIST data set. Please Help! In class, we mentioned the MNIST data set of handwritten digits. You can obtain it from: http://yann.lecun.com/exdb/mnist/index.html
Matlab Coding for MNIST data set. Please Help!
In class, we mentioned the MNIST data set of handwritten digits. You can obtain it from: http://yann.lecun.com/exdb/mnist/index.html In this problem, you will build a classifier for this data by modeling each class as a probability distribution. (a) Upon downloading the data, you should have two training files (one with images, one with labels) and two test files. Unzip them. Load the data into MATLAB (you can use any other platform that you are familiar with including Python) The MNIST database contains 60,000 training images and 10,000 testing images. Four files are available on this site: train-images-idx3-ubyte.gz: training set images (9912422 bytes) train-labels-idxl-ubyte.gz: training set labels (28881 bytes) t10k-images-idx3-ubyte.gz: test set images (1648877 bytes) t10k-labels-idx1-ubyte.gz: test set labels (4542 bytes) (b) Model each class using Bernoulli distribution. Use all of the training images. Determine the class probabilities: what fraction to of the training points are digit 0, for instance? Call these values ro, ..., 19. Fit a Bernoulli density Pj(x) to each digit. You can classify test images using Bayes' rule: simply pick the digit for which TjPj(x) is largest. (c) Turn in: All your code. Error rate on the MNIST test set. Out of the misclassified test digits, pick five at random and display them. For each instance, list the posterior probabilities Pr(y x) of each of the ten classes. In class, we mentioned the MNIST data set of handwritten digits. You can obtain it from: http://yann.lecun.com/exdb/mnist/index.html In this problem, you will build a classifier for this data by modeling each class as a probability distribution. (a) Upon downloading the data, you should have two training files (one with images, one with labels) and two test files. Unzip them. Load the data into MATLAB (you can use any other platform that you are familiar with including Python) The MNIST database contains 60,000 training images and 10,000 testing images. Four files are available on this site: train-images-idx3-ubyte.gz: training set images (9912422 bytes) train-labels-idxl-ubyte.gz: training set labels (28881 bytes) t10k-images-idx3-ubyte.gz: test set images (1648877 bytes) t10k-labels-idx1-ubyte.gz: test set labels (4542 bytes) (b) Model each class using Bernoulli distribution. Use all of the training images. Determine the class probabilities: what fraction to of the training points are digit 0, for instance? Call these values ro, ..., 19. Fit a Bernoulli density Pj(x) to each digit. You can classify test images using Bayes' rule: simply pick the digit for which TjPj(x) is largest. (c) Turn in: All your code. Error rate on the MNIST test set. Out of the misclassified test digits, pick five at random and display them. For each instance, list the posterior probabilities Pr(y x) of each of the ten classesStep 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