I have fitted an SVM with a linear kernel to some randomly generated data. The code is shown below.
import pandas as pd
import numpy as np
from sklearn.svm import SVC
np.random.seed(3)
x = np.random.randn(20,2)
y = np.repeat([1,-1], 10)
#Adding 1 to each of the observations:
x[y == -1] = x[y == -1]+1
from sklearn.svm import SVC
#Fitting the SVM
svc = SVC(kernel='linear', C=10)
svmfit = svc.fit(x,y)
In R, using the command summary(svmfit) gives a nice and brief description of the parameters of the SVM as shown below (I have taken the image from Introduction to Statistical Learning, Chapter 9 - Support Vector Machines from the lab exercises)
.
I'm unable to find a similar function in Python. I am aware I can use the attributes of SVM like the classes_, support_vectors_, n_support_ to get them individually.
But I would like to have it similar to the summary() function in R.
Is there such a function or library that exists which I might have missed while searching?
(Because I also know that statsmodels gives a very nice description of the regression models similar to R)