import numpy as np
from sklearn import linear_model, datasets
import matplotlib.pyplot as plt
def onehot(y):
n = len(np.unique(y)
m = y.shape[0]
b = np.zeros(m, n)
for i in xrange(m):
b[i,y[i] = 1
return b
def softmax(X):
return (np.exp(X).T / np.sum(np.e