
Of course there's one more thing that I should always be doing when I'm

practicing machine learning.

And that we've neglected so far which is visualizing our results so

let me do that right now.

So what I do here, I make a scatter plot of all my data points and

then I also write a line like this.

plt.plot is going to draw a line.

The x values of some of the points along the line will be the ages.

And the y values will be the predictions for

the ages that are given to me by the regression.

So these are kind of like the features and

the predictions and then this is just some formatting information.

Then I apply some labels and I show it.

And I use the show command to see it and

it gives me a picture that looks like this.

Where these are all the points that we had just like before, and

now I've overlayed them with this blue line.

And just by eye you can tell the regression isn't doing anything crazy.

Always a good sanity check is just to look at the results of your regression.

Especially if it's a one dimensional regression like this where you only have

one input variable, like the ages.

Then it's very straightforward to just look at it by eye and

see how things are going.