English subtitles

← 29-01 Find_Weight

29-01 Find_Weight

Get Embed Code
3 Languages

Showing Revision 2 created 11/02/2015 by Udacity Robot.

  1. In this unit here, we'll have fun.
  2. Somehow in the last couple of days on Facebook,
  3. a discussion brought out what Sebastian's weight is.
  4. And I decided rather than telling people how much I weigh I turned this into statistics.
  5. And upfront I want you to put everything together what we've done so far
  6. using programming and since programming has been optional in this class
  7. consider this unit optional but it'd be great if you had a chance to try it.
  8. It's not that hard and at the end of the day you'll know something about me
  9. that I rarely discuss in public.
  10. Through a comment I made in class on Facebook a discussion erupted in our
  11. Facebook STATS 101 discussion group what my actual weight is.
  12. And here is the form that I posted.
  13. They were asked to submit their best estimate how much I weight in kilograms,
  14. and also to submit how much they thought I weighed a year ago.
  15. And within a few hours, there was a good number of guesses
  16. including this one over here that's about as much as the planet Pluto weighs
  17. and also some negative guesses.
  18. These are both the negative weight of Pluto each.
  19. But other than that, there were lots of really good guesses.
  20. And you can see in kilograms, some people think I weigh 80 or 65, others think I weigh 250.
  21. I took the good guesses and added them into a large list called weight.
  22. That's just below 100 of those and now I want to do a statistics on those.
  23. The very first thing I did is I printed the mean estimate and it turns out to be negative.
  24. It's -2.10x10²⁰, and it's a typical situation in statistics.
  25. When you look at those numbers, most of them are actually pretty good guesses.
  26. But these extreme guesses of 10²² or -10²² over here completely affect
  27. and screw up the actual statistics.
  28. Now, you've learned how to deal with this. You know everything about statistics.
  29. What I want you to do is to now code a piece of software called calculate_weight
  30. that has 3 things, and I think you can do all three of them yourself.
  31. First, I want you to remove the outliers by only extracting data
  32. between the lower and upper quartile.
  33. It turns out the number of data points make it well defined
  34. what the lower and upper quartile is.
  35. And all test cases we run through have a well-defined number of data points.
  36. And all the test cases we'll be using will have the property
  37. that the lower and upper quartile are well-defined elements.
  38. Then, I want you to fit a Gaussian using the maximum likelihood estimator.
  39. And from there, I want you to compute the value x that corresponds
  40. to the standard score z, so I'll be giving you not just the weight statistics or the weight data
  41. but also where my extra weight is.
  42. If you plug in the standard score of -2, which is two standard deviations below the mean
  43. of the data that we will estimate, you'll find out my extra weight that I took this morning.
  44. It's amazingly accurate.
  45. But definitely, the data that you guys provided for this was overestimating my weight
  46. and I'm happy to report by two standard deviations.
  47. All these formulas are known,
  48. and I think you have all the coding skills necessary from the past to fill these gaps.
  49. Obviously, the first step is the hardest.
  50. And when you're done with it, this command over here will give you the correct answer.