Question: let's use the imshow function to look at the first few images in the training set. # Create a figure with subplots. This returns a

let's use the imshow function to look at the first few images in the training set.

# Create a figure with subplots. This returns a list of object handles in axs

# which we can use to populate the plots.

fig, axs = plt.subplots(nrows=1, ncols=5, figsize=(10,5))

for i in range(5):

image = X_train[i]

label = Y_train[i]

label_name = label_names[label]

axs[i].imshow(image, cmap='gray')

axs[i].set_title(label_name)

axs[i].axis('off')

plt.show()

Now, Display the first 5 images for each class in a 10x5 grid. Feel free to use the code above to get started. need to use matplotlib documentation.

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!