For this example, we will create a linear separator from the iris dataset. We know from prior chapters that the sepal length and petal width create a linear separable binary dataset for predicting whether a flower is I. setosa or not.
Working with a linear SVM
Getting ready
To implement a soft separable SVM in TensorFlow, we will implement the specific loss function, as follows:
Here, A is the vector of partial slopes, b is the intercept, is a vector of inputs, is the actual class, (-1 or 1), and is the soft separability regularization parameter.
How to do it...
We...