I am currently performing multi class SVM with linear kernel using python\'s scikit library. The sample training data and testing data are as given below:
Model dat
You can use mlxtend. It's quite clean.
First do a pip install mlxtend
, and then:
from sklearn.svm import SVC
import matplotlib.pyplot as plt
from mlxtend.plotting import plot_decision_regions
svm = SVC(C=0.5, kernel='linear')
svm.fit(X, y)
plot_decision_regions(X, y, clf=svm, legend=2)
plt.show()
Where X is a two-dimensional data matrix, and y is the associated vector of training labels.