5 Using lines to split our points: The perceptron algorithm

 

In this chapter

  • what is classification
  • sentiment analysis: how to tell if a sentence is happy or sad using machine learning
  • how to draw a line that separates points of two colors
  • what is a perceptron, and how do we train it
  • coding the perceptron algorithm in Python and Turi Create

In this chapter, we learn a branch of machine learning called classification. Classification models are similar to regression models, in that their aim is to predict the labels of a dataset based on the features. The difference is that regression models aim to predict a number, whereas classification models aim to predict a state or a category. Classification models are often called classifiers, and we’ll use the terms interchangeably. Many classifiers predict one of two possible states (often yes/no), although it is possible to build classifiers that predict among a higher number of possible states. The following are popular examples of classifiers:

  • A recommendation model that predicts whether a user will watch a certain movie
  • An email model that predicts whether an email is spam or ham
  • A medical model that predicts whether a patient is sick or healthy
  • An image-recognition model that predicts whether an image contains an automobile, a bird, a cat, or a dog
  • A voice recognition model that predicts whether the user said a particular command

The problem: We are on an alien planet, and we don’t know their language!

 
 
 
 

How do we determine whether a classifier is good or bad? The error function

 

How to find a good classifier? The perceptron algorithm

 
 
 

Coding the perceptron algorithm

 
 

Applications of the perceptron algorithm

 
 

Summary

 
 
 

Exercises

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage