I'm trying to use OneClassSVM with GridSearchCV as follows:
param_grid={'nu':[0.0001,0.001,0.01,0.1,1],'gamma':[0.0001,0.001,0.01,0.1,1],'kernel':['rbf','poly','linear']}
svc=svm.OneClassSVM()
model=GridSearchCV(svc,param_grid)
But the command
model.fit(X_train, y_train)
Gives me the error:
TypeError: If no scoring is specified, the estimator passed should have a 'score' method. The estimator OneClassSVM(cache_size=200, coef0=0.0, degree=3, gamma='scale', kernel='rbf',
max_iter=-1, nu=0.5, shrinking=True, tol=0.001, verbose=False) does not.
P.S. Using SVC instead of OneClassSVM works.