Skip to Content
Thoughtful Machine Learning
book

Thoughtful Machine Learning

by Matthew Kirk
September 2014
Intermediate to advanced
236 pages
5h 20m
English
O'Reilly Media, Inc.
Content preview from Thoughtful Machine Learning

Chapter 6. Support Vector Machines

What makes a user loyal or not? Loyalty in commerce generally has to do with users returning to buy things consistently over time. But how do you actually measure the deciding factor between loyal and disloyal?

In this chapter, we’ll set out to solve that problem conceptually by utilizing Support Vector Machines. This algorithm utilizes many feature objects while yielding a deciding line between one class and the other (e.g., loyal and disloyal). We’ll finish up with a worked-out example about attaching sentiment to movie reviews.

Solving the Loyalty Mapping Problem

Our online store has two sets of customers, loyal and disloyal. The loyal customers return to the site consistently and buy from the company, while the disloyal customers are either window shoppers or spendthrifts who don’t care about the company. Our goal is to determine what makes a customer loyal and disloyal with respect to the number of orders they place and their average order size.

Let’s imagine our data looks something like Figure 6-1.

loyal and disloyal customers
Figure 6-1. There’s a discernible difference between loyal and disloyal customers

As we’re approaching this problem for the first time, there are many ways we could build something to decide whether users are loyal or disloyal. We could utilize a K-Nearest Neighbors classification program (as described in Chapter 3), which effectively clusters ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Thoughtful Machine Learning with Python

Thoughtful Machine Learning with Python

Matthew Kirk
Basiswissen Softwaretest

Basiswissen Softwaretest

Andreas Spillner, Tilo Linz
Build, Borrow, or Buy

Build, Borrow, or Buy

Laurence Capron, Will Mitchell

Publisher Resources

ISBN: 9781449374075Errata Page