Book Image

Python Machine Learning Blueprints: Intuitive data projects you can relate to

By : Alexander T. Combs
Book Image

Python Machine Learning Blueprints: Intuitive data projects you can relate to

By: Alexander T. Combs

Overview of this book

<p>Machine Learning is transforming the way we understand and interact with the world around us. But how much do you really understand it? How confident are you interacting with the tools and models that drive it?</p> <p>Python Machine Learning Blueprints puts your skills and knowledge to the test, guiding you through the development of some awesome machine learning applications and algorithms with real-world examples that demonstrate how to put concepts into practice.</p> <p>You’ll learn how to use cluster techniques to discover bargain air fares, and apply linear regression to find yourself a cheap apartment – and much more. Everything you learn is backed by a real-world example, whether its data manipulation or statistical modelling.</p> <p>That way you’re never left floundering in theory – you’ll be simply collecting and analyzing data in a way that makes a real impact.</p>
Table of Contents (16 chapters)
Python Machine Learning Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Support vector machines


We're going to be utilizing a new classifier in this chapter, the linear support vector machine. A support vector machine is an algorithm that attempts to linearly separate data points into classes using a "maximum-margin hyperplane". This is a mouthful, so let's look at what this really means.

Suppose we have two classes of data, and we want to separate them with a line. (We'll just deal with two features, or dimensions, here.) What is the most effective way to place this line?

Image from https://commons.wikimedia.org/wiki/File:Svm_separating_hyperplanes_(SVG).svg

In the preceding figure, line H1 does not effectively discriminate between the two classes, so we can eliminate this one. Line H2 is able to discriminate between them cleanly, but H3 is the maximum-margin line. This means that the line is centered between the two nearest points of each class, which are known as the support vectors. These can be seen as the dotted lines in the following figure:

Image from...