English subtitles

← Visualizing Regression - Intro to Machine Learning

Get Embed Code
4 Languages

Showing Revision 3 created 05/25/2016 by Udacity Robot.

  1. Of course there's one more thing that I should always be doing when I'm
  2. practicing machine learning.
  3. And that we've neglected so far which is visualizing our results so
  4. let me do that right now.
  5. So what I do here, I make a scatter plot of all my data points and
  6. then I also write a line like this.
  7. plt.plot is going to draw a line.
  8. The x values of some of the points along the line will be the ages.
  9. And the y values will be the predictions for
  10. the ages that are given to me by the regression.
  11. So these are kind of like the features and
  12. the predictions and then this is just some formatting information.
  13. Then I apply some labels and I show it.
  14. And I use the show command to see it and
  15. it gives me a picture that looks like this.
  16. Where these are all the points that we had just like before, and
  17. now I've overlayed them with this blue line.
  18. And just by eye you can tell the regression isn't doing anything crazy.
  19. Always a good sanity check is just to look at the results of your regression.
  20. Especially if it's a one dimensional regression like this where you only have
  21. one input variable, like the ages.
  22. Then it's very straightforward to just look at it by eye and
  23. see how things are going.