DOC fix dataset used for visualization in digits classification example
@@ -78,8 +78,9 @@ predicted = clf.predict(X_test)
# digit value in the title.
_, axes = plt.subplots(nrows=1, ncols=4, figsize=(10, 3))
-for ax, image, prediction in zip(axes, digits.images, predicted):
+for ax, image, prediction in zip(axes, X_test, predicted):
ax.set_axis_off()
+ image = image.reshape(8, 8)
ax.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')
ax.set_title(f'Prediction: {prediction}')
