Plotting the Result

An experiment result should be inspected, not only printed.

For a fitted line, plot:

  • the noisy data points;
  • the fitted line;
  • labels that explain the axes.

Plot data and fitted line

Runs locally with Python in your browser.

Ready to run.

The plot should support a sentence:

The fitted line passes close to the noisy data points.

Plot before trusting the number

A low loss is useful, but it is not the whole story. A plot can reveal:

  • one large outlier;
  • a curved pattern that a line cannot fit;
  • a swapped or shuffled array;
  • a scale problem.
Exercise: Plot components

For this experiment, what two things should be shown in the plot?

Choose one

Select one choice, then check.

Hint

The plot should make it possible to compare the observations with the model.

Solution

Show the noisy data points and the fitted line. Their relationship is the visual evidence; either one alone removes the comparison.