I am trying to find best parameters using GridSearch and then also find out support vectors using the best parameters.
Here is the code:
tuned_parameters = [{'kernel': ['linear'], 'C': [0.00001,0.0001,0.001,0.1,1, 10, 100, 1000],
'decision_function_shape':["ovo"]}]
clf = GridSearchCV(SVC(), tuned_parameters, cv=5)
clf.fit(X, Y)
print("Best parameters set found on development set:")
print()
print(clf.best_params_)
# Predicting on the unseen test data
predicted_test = clf.predict(X_test)
# Calculating Accuracy on test data
accuracy_test=accuracy_score(Yt, predicted_test)
support_vec=clf.support_vectors_
print(support_vec)
Error:
AttributeError: 'GridSearchCV' object has no attribute 'support_vectors_'
sklearn 0.21.2
How to fix this issue?