Created
August 16, 2018 16:40
-
-
Save chmodsss/3cb3fe22a1b53ebb137142919b4ad9e0 to your computer and use it in GitHub Desktop.
NN from scratch. data preparation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment