Chapter 4

Support Your Local Vector

IN THIS CHAPTER

Bullet Working with a support vector machine (SVM)

Bullet Using SVMs in R

Bullet An SVM for congressional voting

Classification is an important part of machine learning (ML). One important classifying technique is the support vector machine (SVM). So, what exactly is an SVM and how does it work?

Some Data to Work With

To introduce the SVM, I use the iris data set, which I first discuss in Chapter 1 of Book 4. It provides four measurements on each of 150 irises, with 50 flowers in each of three species.

This data set is useful for examples whose objective is to use the measurements (petal width and length, sepal width and length) as a means of identifying a flower’s species. Though one species (setosa) is distinct from the other two (versicolor and virginica), those other two aren’t completely distinct from one another.

Tip In preceding chapters in Book 4, I tell you how to work with iris.uci, a data set downloaded from the UCI ML repository and subsequently cleaned up. In this chapter, I describe how to work with the iris data set that comes with ...

Get R All-in-One For Dummies 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.