Guest User

Untitled

a guest
Dec 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import numpy as np
  2. from scipy import sparse
  3. from sklearn import svm
  4. from nose.tools import assert_raises
  5.  
  6. X = np.array([[-2, -1], [-1, -1], [-1, -2], [1, 1], [1, 2], [2, 1]])
  7. X_sp = sparse.lil_matrix(X)
  8. Y = [1, 1, 1, 2, 2, 2]
  9.  
  10. sp = svm.sparse.SVC(C=1, kernel=lambda x, y: x * y.T, probability=True)
  11. assert_raises(ValueError, sp.fit, X_sp, Y)
Add Comment
Please, Sign In to add comment