image_output_1.png
from sklearn.model_selection import train_test_split

from sklearn.preprocessing import OneHotEncoder

def history_plot(fit_history):
    keys = list(fit_history.history.keys())[0:4]
def ohe(x):
    return OneHotEncoder(categories='auto').fit(x.reshape(-1, 1)).transform(x.reshape(-1, 1)).toarray().astype('int64')
def tts(X, y):
    x_train, x_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=1)
    n = int(len(x_test) / 2)
    x_valid, y_valid = (x_test[:n], y_test[:n])
    x_test, y_test = (x_test[n:], y_test[n:])
    return (x_train, x_valid, x_test, y_train, y_valid, y_test)

f = h5py.File('../input/LetterColorImages_123.h5', 'r')
keys = list(f.keys())
keys