Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. def plot_matrix(m):
  2. fig = plt.figure(figsize=m.shape)
  3. ax = fig.add_subplot(111)
  4. cax = ax.matshow(m)
  5. fig.colorbar(cax)
  6.  
  7. for f in range(len(misclassified)):
  8. label = y_test[misclassified[f]]
  9. if len(seen) <= 10 and label not in seen:
  10. seen+=label
  11. item = X_train.iloc[misclassified[f]].values.reshape(28, 28)
  12. plot_matrix(item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement