Path: blob/master/april_18/lessons/lesson-03/code/solution-code/solution-code-3.ipynb
1905 views
Kernel: Python 2
Lesson 3 - Solutions
Instructor: Amy Roberts, PhD
In [ ]:
Part 1. Basic Stats
Read in the examples
In [ ]:
Instructor example: Calculate the mean for each coloumn
In [ ]:
Students: Calculate median, mode, max, min for the example
Note: All answers should match your hand calculations
In [ ]:
In [ ]:
In [ ]:
In [ ]:
Part 2. Box Plot
Instructor: Interquartile range
In [ ]:
In [ ]:
In [ ]:
Student: Create plots for examples 2 and 3 and check the quartiles
In [ ]:
What does the cross in example 2 represent?
Answer: an outlier
Part 3. Standard Deviation and Variance
Variance: The variance is how much the predictions for a given point vary between different realizations of the model.
Standard Deviation: Te square root of the variance
<img(src='../../assets/images/biasVsVarianceImage.png', style="width: 30%; height: 30%")>
In Pandas
Let's calculate variance by hand first.
<img(src='../../assets/images/samplevarstd.png', style="width: 50%; height: 50%")>
In [ ]:
In [ ]:
In [ ]:
Students: Calculate the standard deviation by hand for each sample
Recall that standard deviation is the square root of the variance.
In [ ]:
In [ ]:
In [ ]:
Short Cut!
In [ ]:
Student: Check understanding
Which value in the above table is the median?
Answer: 50%
Part 4: Correlation
In [ ]: