We will use the Hand-written digit recognition data set in our homework. The database was collected and analyzed in Le Cun et al. (1990). There is a total of 9298 digitized numbers in the database where 7291 of them are used as a training set and 2549 of them are used as a test set. The images were scanned from the U.S. Mail envelopes passing through the Buffalo N.Y. post office. The scanned images were size normalized and de-slanted to fit a 16×16 pixel box. The resulting images are in the form of 16×16 grayscale intensities of images. The training data set containing 7291 rows and 258 columns where the first column is the digit ID (0-9) the second to the 257th column contains the 256 grayscale values and the last column is redundant. The digit ID the actual number for the image given in the corresponding row.Please also pay attention to two points below: Pixels are arranged row-wisely in each row of the data set; From the smallest values to the largest values in the matrix the color changes from white to black
Q1. Read the training data set and test data set into R as matrices. Randomly sample 700 numbers (rows) from the training data set and randomly sample 200 numbers from the test data set. Create one matrix that includes the first 257 columns of the randomly sampled training data set and another matrix that includes the first 257 columns of the randomly sampled test data set.
Q2. Create two frequency tables to count the numbers of images corresponding to the digit ID (0-9) in both the sampled training and test data sets in Q1.
Q3. (a) Create a matrix A0 to include rows that corresponding to the digit ID 0 and the 2nd to 257th columns in the sampled training data set. (d) Repeat parts (a)-(c) for the other digit IDs 1 to 9. Finally combine all the first two projections obtained in part (c) in to a matrix with the first column being the first project and second column being the second projection.
Q4. Visualize the first 6 images of each digit ID in the sampled training and test data sets in Q1. Place all the images from the training data set (or the test data set) in the same plot and label each image with its corresponding row number in the data set.
Requirements: In R
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more