lab10.pdf - In[1 Initialize OK from client.api.notebook import Notebook ok = Notebook'lab10.ok = Assignment Conditional Probability OK version v1.12.5 =

lab10.pdf - In[1 Initialize OK from client.api.notebook...

This preview shows page 1 - 4 out of 22 pages.

In [1]: Conditional Probability This lab is an introduction to conditional probabilities. The lab includes a visualization called an icon array . It's meant to be an instructional part of the lab to help build intuitions about conditional probability. These visualizations do not appear in the textbook and will not appear on any exam. ===================================================================== Assignment: Conditional Probability OK, version v1.12.5 ===================================================================== # Initialize OK from client.api.notebook import Notebook ok = Notebook( 'lab10.ok' )
Image of page 1
In [2]: ===================================================================== Assignment: Conditional Probability OK, version v1.12.5 ===================================================================== Saving notebook... Saved 'lab10.ipynb'. Submit... 100% complete Submission successful for user: [email protected] URL: () # Run this cell to set up the notebook, but please don't change it. # These lines import the Numpy and Datascience modules. import numpy as np from datascience import * # These lines do some fancy plotting magic. import matplotlib % matplotlib inline import matplotlib.pyplot as plt plt.style.use( 'fivethirtyeight' ) import warnings warnings.simplefilter( 'ignore' , FutureWarning) # This line loads the visualization code for this lab. import visualizations # These lines load the tests. from client.api.notebook import Notebook ok = Notebook( 'lab10.ok' ) _ = ok.submit()
Image of page 2
1. What is conditional probability good for? Suppose we have a known population, like all dogs in California. So far, we've seen 3 ways of predicting something about an individual in that population, given incomplete knowledge about the identity of the individual: If we know nothing about the individual dog, we could predict that its speed is the average or median of all the speeds in the population. If we know the dog's height but not its speed, we could use linear regression to predict its speed from its height. The resulting prediction is still imperfect, but it might be more accurate than the population average. If we know the dog's breed, height, and age, we could use nearest-neighbor classification (or multiple regression ) to predict its speed by comparing it to a collection of dogs with known speed. We can also compute conditional probabilities to make predictions about individuals or events. This technique is di ff erent from the previous methods we’ve examined because 1. our prediction for each outcome is described by a probability, and 2. each probability can be exactly calculated from assumptions, as opposed to estimated from data. 2. Icon arrays Parts 3 and 4 of this lab work with a more complex example about disease, but first, let's start with a simple example. Imagine you are a marble. You don't know what you look like (since you obviously have no eyes), but you know that Samantha drew you uniformly at random from a bag that contained the following marbles: 4 large shiny marbles, 1 large dull marble, 6 small shiny marbles, and 2 small dull marbles.
Image of page 3
Image of page 4

You've reached the end of your free preview.

Want to read all 22 pages?

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors