End to End ML Project - Fashion MNIST - Fine-Tuning the Model - Grid Search - Dimensionality Reduction We will perform using 1

import matplotlib
import matplotlib.pyplot as plt

def plot_digits(instances, images_per_row=5, **options):
size = 28
images_per_row = min(len(instances), images_per_row)
images = [instance.reshape(size,size) for instance in instances]
n_rows = (len(instances) - 1) // images_per_row + 1
row_images = []
n_empty = n_rows * images_per_row - len(instances)
images.append(np.zeros((size, size * n_empty)))
for row in range(n_rows):
rimages = images[row * images_per_row : (row + 1) * images_per_row]
row_images.append(np.concatenate(rimages, axis=1))
image = np.concatenate(row_images, axis=0)
plt.imshow(image, cmap = matplotlib.cm.binary, **options)

plt.figure(figsize=(7, 4))

Plotting ‘original’ image

plt.title(“Original”, fontsize=16)

Plotting the corresponding ‘recovered’ image

plt.title(“Compressed”, fontsize=16)

I did not understand.
Please explain.

As mentioned in the instructions of the respective project, this function display the original images and the compressed images (that was recovered after decompression).

I want to know the meaning of each and every line.

about how to plot image??

please reply.