4 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.
  • What are perceptrons, or discrete logistic classifiers.
  • What is the perceptron algorithm?
  • How to draw a line that separates points of two different colors.
  • How to measure the error of a line that separates points of two different colors.
  • How to code the perceptron algorithm in Python.

Here is the problem we’ll tackle in this chapter. How do we teach a computer to determine if a sentence is happy or sad? The way we tackle this is by introducing a branch of machine learning called classification. Much like regression, classification consists of predicting labels according to the features of our data. However, in regression we predicted numbers, such as the price of a house, and in classification, we predict categories, such as sad/happy, yes/no, or dog/cat/bird.

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

4.1.1   A slightly more complicated planet

4.1.2   The bias, the y-intercept, and the inherent mood of a quiet alien

4.1.3   More general cases

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

4.2.1   How to compare classifiers? The error function

4.3       How to find a good classifier? The perceptron algorithm

4.3.1   The perceptron trick

4.4       Repeating the perceptron trick many times: The perceptron algorithm

4.5       Coding the perceptron algorithm

4.5.1   Coding the perceptron trick

4.6       Applications

4.6.1   Applications of the perceptron algorithm

4.7       Some drawbacks of the perceptron algorithm, which will be addressed very soon!

4.8       Summary

sitemap