Training a Support Vector Machine with Linear and Non-Linear Kernels
Linear and non-linear classification with SVMs
In my previous article, I discussed the theoretical part of support vector machines.
It is strongly recommended that you read that article before continuing to read this one.
Today, we will focus on training support vector machines with linear and non-linear kernels. We will build two support vector classification models using the popular Iris Dataset. We will visualize decision boundaries for each model to get an idea about how well the model separates data points into distinct groups.
Training an SVM classification model with a linear kernel
The most common way to perform SVM linear classification is to use the SVC class with a linear kernel. SVC stands for Support Vector Classification. We will create an instance of the SVC() class with a linear kernel.
First, we need to load the classification dataset. In this case, it is the Iris Dataset which consists of 150 samples of three different variants of iris flowers. So, an SVM classification model will try to put these data points into three different groups.