chapter five
5 Using lines to split our points: The perceptron algorithm
This chapter covers
- 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 different colors.
- What is a perceptron?
- What is the perceptron algorithm?
- How to measure the error of a perceptron model.
- Coding the perceptron algorithm in Python and Turi Create.
In this chapter we learn a new branch of machine learning called classification. Classification models are very much like 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, while 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 if a user will watch a certain movie or not.
- An email model that predicts if an email is spam or ham.
- A medical model that predicts if a patient is sick or healthy.
- An image recognition model that predicts if an image contains an automobile, a bird, a cat, or a dog.
- A voice recognition model that predicts if the user said a particular command or not.