# -*- coding: utf-8 -*-
"""
Created on Thu Dec 13 14:50:40 2018
@author: K
"""
import numpy as np
import time
import scipy.io
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
datas = scipy.io.loadmat('ex4data1.mat')
X = datas["X"]
y = datas["y"]
im = X[2098].reshape(20, 20);
plt.imshow(im, cmap='gray')
#plt.imshow(X[0]).reshape([20, 20]);
#print(type(X[0]))
#realout =
Y = np.zeros((5000,1))
for i in range(0, 5000):
for j in range(1, 10):
if np.mod(y[i],2) == 0:
Y[i,0] = 1
else: