Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import matplotlib.pyplot as plt
- from sklearn.datasets import load_digits
- from sklearn.model_selection import train_test_split
- %matplotlib inline
- dig = load_digits()
- plt.gray()
- plt.matshow(dig.images[25])
- onehot_target = pd.get_dummies(dig.target)
- x_train, x_val, y_train, y_val = train_test_split(dig.data, onehot_target, test_size=0.1, random_state=20)
- # shape of x_train :(1617, 64)
- # shape of y_train :(1617, 10)
Add Comment
Please, Sign In to add comment