Guest User

Untitled

a guest
Aug 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import pandas as pd
  2. import matplotlib.pyplot as plt
  3. from sklearn.datasets import load_digits
  4. from sklearn.model_selection import train_test_split
  5.  
  6. %matplotlib inline
  7.  
  8. dig = load_digits()
  9. plt.gray()
  10. plt.matshow(dig.images[25])
  11.  
  12. onehot_target = pd.get_dummies(dig.target)
  13.  
  14. x_train, x_val, y_train, y_val = train_test_split(dig.data, onehot_target, test_size=0.1, random_state=20)
  15. # shape of x_train :(1617, 64)
  16. # shape of y_train :(1617, 10)
Add Comment
Please, Sign In to add comment