ETC3250: Tutorial 7 Help Sheet
Exercises
Question 1
Before doing an analysis you should always get a good idea of the data you are working with. There are some details on the data set here and you can also call ?dataset_fashion_mnist
to get some details.
Question 2
There are several functions for checking the details of a data set, they include dim
, glimpse
, head
, summarise
, etc. To plot the images, you can just use ggplot
. The images are 28x28 pixel
It is important to know what your data looks like after every transformation too. That way you understand the input and output of every function. After running those code fashion_mnist$train
is a list that contrains two datasets, x
and y
. fashion_mnist$train$x
is an 60000 x 28 x 28 dimension array. That means
Question 4
Check lecture 6 slide 5-6 for a simple neural network structure, and check lecture 6 slide 11-12 for a look at how this structure fits into the model process
Your final layer is related to what you are trying to predict, and your hidden layers are related to model flexibility.
Read the help sheet for the compile function to understand these parameters. ?keras::compile.keras.engine.training.Model
should take you there (there are a lot of functions called compile so using the full name is easier). Lecture 6 slide 11-12 also have some information related to this question. You can also
Question 6
Typically if you get a different result to someone else despite running identical code on an identical data set, it means the function uses randomness somewhere in the function. Think about where a neural network might use randomness and think about what function could be used to prevent this from happening.
Question 7
This code will provide you with a confusion matrix. If a particular class if frequently predicted as another class, this will appear in the confusion matrix as a large number off the diagonal.
Question 9
By “Explain how the class structure matches any clustering” Di means you should explain if the classes are visibly separated in the PCA and UMAP plots.
If one of these methods can separate the classes and another cannot, what does that say about our method and/or input?
Lecture 6 slide 55 has an example of a simple case where you need to interpret a 3D simplex (three classes). This question requires