Created
June 5, 2015 15:20
-
-
Save Mengyuz/55974b763991a5dbfe87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy | |
import matplotlib.pyplot as plt | |
def plot_residuals(turnstile_weather, predictions): | |
''' | |
Using the same methods that we used to plot a histogram of entries | |
per hour for our data, why don't you make a histogram of the residuals | |
(that is, the difference between the original hourly entry data and the predicted values). | |
Try different binwidths for your histogram. | |
Based on this residual histogram, do you have any insight into how our model | |
performed? Reading a bit on this webpage might be useful: | |
http://www.itl.nist.gov/div898/handbook/pri/section2/pri24.htm | |
''' | |
plt.figure() | |
(turnstile_weather['ENTRIESn_hourly'] - predictions).hist() | |
return plt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment