Why Plot?

A plot helps you inspect numerical data with your eyes.

That is useful because many mistakes are visible before they are obvious in code:

  • values grow when they should shrink;
  • one point is far outside the rest;
  • a curve bends the wrong way;
  • two arrays were paired in the wrong order;
  • a distribution is wider than expected.

Numbers can hide shape

The values are readable. But the shape of the relationship is easier to see as a curve.

See the pattern

Runs locally with Python in your browser.

Ready to run.

Plot before the problem is large

Use small plots early. Do not wait until the program has thousands of values. A tiny plot can check the idea before scale makes the mistake harder to see.

A plot needs a question

Before plotting, ask:

What am I trying to notice?

Examples:

  • Does loss go down?
  • Are predictions near targets?
  • Are values centered around zero?
  • Does one feature have a strange range?
Exercise: Purpose of a plot

Which answer best describes why this chapter uses plots?

Choose one

Select one choice, then check.

Hint

The useful plot is the one that helps you notice a pattern or mistake in the numbers or computation.

Solution

This chapter uses plots to inspect data and computation. A plot can expose a pattern, outlier, or incorrect curve that is difficult to notice in a table of values.