liveBook · Manning

Perceptron

As explained in Machine Learning Algorithms in Depth

A linear binary classifier that predicts a class from the sign of a weighted sum of input features.

A perceptron is a linear binary classifier. For a feature vector x, weights θ, and offset θ₀, it predicts h(x) = sign(θ·x + θ₀), assigning a label of +1 or −1. The equation θ·x + θ₀ = 0 defines its decision boundary: a hyperplane whose normal vector is θ. section 5.2

Training is mistake-driven. Compare each prediction with its ground-truth label y; a negative product y·h(x) indicates disagreement. The implementation initializes θ and θ₀ to zero, repeatedly samples training examples, and updates when y(θ·x + θ₀) ≤ 0. These updates move the decision boundary toward fewer classification mistakes. section 5.2 section 5.8

Iris binary classification

Fit the classifier to iris features, then compare predicted and actual labels in a confusion matrix. True positives and true negatives are correct predictions; false positives and false negatives are mistakes. The same counts support measures such as true positive rate and false positive rate. section 5.2

Figure 5.2 Linear classifier a decision boundary
figure

The two-dimensional diagram shows how a linear decision boundary separates the +1 and −1 sides. section 5.2

How Machine Learning Algorithms in Depth covers it

How deep it goes
Derives the prediction rule and decision-boundary geometry, then gives a from-scratch training implementation and evaluation measures.
Examples
Uses iris binary classification, a two-dimensional decision-boundary figure, implementation pseudocode, and a confusion matrix.
What it assumes
Uses feature vectors, inner products, signed labels, and indicator notation while defining the classifier and its evaluation measures.
What you can do after
Build it from scratch and evaluate its binary predictions with a confusion matrix.
How it connects
Connects linear classifiers to hyperplanes, indicator functions, confusion matrices, ROC curves, and precision-recall curves.

Also explained in

Compare how 5 books explain perceptron →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Algorithms in Depth. The section links point to the parts of the book it draws on.