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:
![](https://static.packt-cdn.com/products/9781789131680/graphics/assets/11e1a288-7294-4c7c-bbee-37e854bbf309.png)
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...