Smarter Binge Watching With Linear Regression
I am not much of a binge watcher but I do enjoy quality TV shows which is why I think GraphTV is so great. GraphTV plots the IMDb user ratings for every episode and then performs a linear regression of the episode rating by the episode number to create a trend line which helps you see if the show gets better or worse over the course of the season.
To solve this I created a GitHub repo binge-trendy. Because the trend line is fit to the IMDb user rating data, we are interested in which episodes do IMDb users think are better than the regression model predicts which translates to any deviation from the trend line. Since I am only interested in episodes that are rated higher than the regression model would have predicted, I only look at episodes with a positive residual.
For example, Golden Girls season 4
|4||1||Yes, We Have No Havanas|
|4||2||The Days and Nights of Sophia Petrillo|
|4||6||Sophia’s Wedding: Part 1|
|4||14||Love Me Tender|
|4||19||Till Death Do We Volley|
|4||23||Rites of Spring|
I realize the code is not great, pylint currently gives it a 6.05 but if there is one thing I have learned in software:
The only way to write good code is to write tons of shitty code first. Feeling shame about bad code stops you from getting to good code— Hadley Wickham (@hadleywickham) April 17, 2015