Skip to content

Instantly share code, notes, and snippets.

@Killavus
Created January 29, 2016 00:36
Show Gist options
  • Save Killavus/85ce033d94d58cfc6886 to your computer and use it in GitHub Desktop.
Save Killavus/85ce033d94d58cfc6886 to your computer and use it in GitHub Desktop.
svc = SGDClassifier(loss='squared_hinge', verbose=1, n_jobs=8, n_iter=100)
svc.fit(train_data, train_labels)
predictions = svc.predict(validation_data)
wrong = np.nonzero(validation_labels - predictions)[0].astype(np.float).shape[0]
print (float(wrong) / predictions.shape[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment