def test_svc():
 (X_blobs, y_blobs) = make_blobs(n_samples=100, centers=10, random_state=0)
 X_blobs = sparse.csr_matrix(X_blobs)
 datasets = [[X_sp, Y, T], [X2_sp, Y2, T2], [X_blobs[:80], y_blobs[:80], X_blobs[80:]], [iris.data, iris.target, iris.data]]
 kernels = ['linear', 'poly', 'rbf', 'sigmoid']
 for dataset in datasets:
  for kernel in kernels:
   clf = svm.SVC(kernel=kernel, probability=True, random_state=0, decision_function_shape='ovo')
   sp_clf = svm.SVC(kernel=kernel, probability=True, random_state=0, decision_function_shape='ovo')
   check_svm_model_equal(clf, sp_clf, *dataset)

def test_svc ( ) : ( X_blobs , y_blobs ) = make_blobs ( n_samples = 100 , centers = 10 , random_state = 0 ) X_blobs = sparse . csr_matrix ( X_blobs ) datasets = [ [ X_sp , Y , T ] , [ X2_sp , Y2 , T2 ] , [ X_blobs [ : 80 ] , y_blobs [ : 80 ] , X_blobs [ 80 : ] ] , [ iris . data , iris . target , iris . data ] ] kernels = [ 'linear' , 'poly' , 'rbf' , 'sigmoid' ] for dataset in datasets : for kernel in kernels : clf = svm . SVC ( kernel = kernel , probability = True , random_state = 0 , decision_function_shape = 'ovo' ) sp_clf = svm . SVC ( kernel = kernel , probability = True , random_state = 0 , decision_function_shape = 'ovo' ) check_svm_model_equal ( clf , sp_clf , * dataset )
check that sparse svc gives the same result as svc .