Handwritten digits dataset
The handwritten digits dataset has around 160 records for each digit ranging from 0 to 9. Each record is formed by 256 columns that takes the value 0 or 1, representing an image of 16x16 pixels.
Later in the course, you will use this data to identify the clusters that can explain the digits using flexmix
. Now, the aim is to get familiar with datasets that can be modeled with mixture models using Bernoulli distribution.
The object data
has the observations of only two digits from the original dataset.
This exercise is part of the course
Mixture Models in R
Exercise instructions
- Use
dim()
to check the dimension of the data frame. - Use
glimpse()
to check the data. This is a handy function to check every column, especially when there are many. - Use the function
show_digit()
to parse the rows 50 and 100 into an image.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Dimension
dim(___)
# Apply glimpse to the data
___(data)
# Digit in row 50
show_digit(data[___,])
# Digit in row 100
show_digit(data[___,])