8000 DOC fix dataset used for visualization in digits classification examp… · scikit-learn/scikit-learn@2800878 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2800878

Browse files
authored
DOC fix dataset used for visualization in digits classification example (#19095)
1 parent 377776b commit 2800878

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/classification/plot_digits_classification.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@
7878
# digit value in the title.
7979

8080
_, axes = plt.subplots(nrows=1, ncols=4, figsize=(10, 3))
81-
for ax, image, prediction in zip(axes, digits.images, predicted):
81+
for ax, image, prediction in zip(axes, X_test, predicted):
8282
ax.set_axis_off()
83+
image = image.reshape(8, 8)
8384
ax.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')
8485
ax.set_title(f'Prediction: {prediction}')
8586

0 commit comments

Comments
 (0)
0