How it works...

Our goal was to fit a line between the I. setosa points and the other two species using only petal width and petal length. If we plot the points and the resultant line, we see that we have achieved this:

Figure 7: Plot of I. setosa and non-setosa for petal width versus petal length; the solid line is the linear separator that we achieved after 1,000 iterations

Get TensorFlow Machine Learning Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.