Lines and Hyperplanes

A line in two dimensions can be written as:

wx+b=0w \cdot x + b = 0

Here, xx is a point, ww is a normal vector, and bb is an offset.

The normal vector points across the line, not along it.

positivenegativenormal ww . x + b = 0
A hyperplane separates space. The normal vector points across it.

Boundary Scores

The expression:

wx+bw \cdot x + b

is a signed score.

  • positive value: one side
  • negative value: the other side
  • zero: on the boundary

This is why a linear classifier can classify points by a sign.

MATH-C04-T06-001Exercise: Evaluate a boundary

Let w = [1, -1], b = 0, and x = [3, 3].

Compute w . x + b.

Compute it first, then check your number.

HintDot product first

Compute the dot product first.

SolutionBoundary score

Compute the signed score:

wx+b=1(3)+(1)(3)+0=0w \cdot x + b = 1(3) + (-1)(3) + 0 = 0

A score of zero means the point lies on the boundary.

Normal Direction

The vector ww is perpendicular to the boundary.

That means it points in the direction of fastest score change. Moving along the boundary keeps the score at zero. Moving in the normal direction changes the score.

This is often the most useful way to read a linear model. The vector ww does not merely store coefficients. It names the direction in input space that increases the score most directly. The boundary is perpendicular to that direction.

MATH-C04-T06-002Exercise: Read the normal vector

Enter 1 if the normal vector points across the boundary, or 2 if it points along the boundary.

Compute it first, then check your number.

HintNormal means perpendicular

A normal vector is perpendicular to the line or hyperplane.

SolutionAcross the boundary

Enter 1. The normal vector points across the boundary, not along it. It points in the direction where the score changes most directly.

MATH-C04-T06-004Exercise: Read score movement

Enter 1 if moving in the normal direction changes the boundary score, while moving along the boundary keeps the score constant.

Compute it first, then check your number.

HintAcross versus along

Along the boundary, wx+bw \cdot x + b remains zero.

SolutionNormal changes the score

Enter 1. A boundary is a set of equal score. The normal direction points across that set, where the score changes.

Hyperplanes

In two dimensions, a hyperplane is a line.

In three dimensions, a hyperplane is a plane.

In nn dimensions, a hyperplane has dimension n1n - 1.

We use the same equation:

wx+b=0w \cdot x + b = 0
MATH-C04-T06-003Exercise: Classify by sign

Let w = [1, -1], b = 0, and x = [4, 2].

What is w . x + b?

Compute it first, then check your number.

HintSigned score

Positive and negative values indicate opposite sides.

SolutionPositive side
wx+b=1(4)+(1)(2)+0=2w\cdot x + b = 1(4) + (-1)(2) + 0 = 2

The score is positive, so the point is on the positive side of the boundary.

Before Moving On

Hyperplanes are geometric boundaries written as dot products.