from scipy import io

d = io.loadmat('comparison.mat')

X = d['X']
Y = d['Y'][:,0]

from sklearn.multiclass import OneVsRestClassifier
from sklearn import svm

svm = OneVsRestClassifier(svm.SVC(kernel='linear', C=.01)).fit(X,Y)

print 'train acc'
print (Y == svm.predict(X)).mean()

new_X = d['newX']
new_y = d['new_Y']
pred_y = svm.predict(new_X)

print 'test acc'
print (pred_y == new_y).mean()
