For this investigation we are going to use the sleepdata data set from the lme4 package. Here is the head of the data frame:
This file contains hidden or 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
| # Convert your notebook to an interactive webpage | |
| # | |
| # Attached a notebook (really-interactive-posts.ipynb) and the generated | |
| # output (really-interactive-posts.html). The thebe.tpl template file is | |
| # at the very end of the gist. | |
| $ jupyter nbconvert --template thebe.tpl --to html <notebook.ipynb> | |
| # You can open the generated webpage locally file://... howerver some |
This file contains hidden or 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
| Write a program that does what it’s supposed to do | |
| Write idiomatic code | |
| Debug a program that you wrote | |
| Debug a program someone else wrote | |
| Debug the interaction between a system you wrote and one you didn’t | |
| File a good bug report | |
| Modify a program you didn’t write | |
| Test a program you wrote | |
| Test a program you didn’t write | |
| Learn a new programming language |
This file contains hidden or 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
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import math | |
| def calc_ab(alpha_a, beta_a, alpha_b, beta_b): | |
| ''' | |
| See http://www.evanmiller.org/bayesian-ab-testing.html | |
| αA is one plus the number of successes for A |
This file contains hidden or 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
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the | |
| software to the public domain. We make this dedication for the benefit |
This file contains hidden or 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
| 19:40John B.: Hello Matt! How may I help you? | |
| 19:41Matt M.: Hi John. I need to lower my bill. Comcast internet is much cheaper. Thinking of switching | |
| 19:43Matt M.: They are offering me $34.99/mo my latest RCN bill is $49.99 | |
| 19:43John B.: Let me see what I can do, sir. I'd be happy to help you. May I please have your address and phone number? | |
| 19:44Matt M.: Sure. XXXXXXXXX, MA XXXXX and my phone number is XXX-XXX-XXXX. | |
| 19:45John B.: Thank you sir. One moment please while I research what I can do. | |
| 19:45Matt M.: Great thanks. | |
| 19:48John B.: I tried to put you in the $34.99 plan, however the system knows your an active customer and denies me. | |
| 19:49John B.: But we do have another option! | |
| 19:49Matt M.: OK. What are you thinking? |
This file contains hidden or 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
| """ | |
| This module implements the Lowess function for nonparametric regression. | |
| Functions: | |
| lowess Fit a smooth nonparametric regression curve to a scatterplot. | |
| For more information, see | |
| William S. Cleveland: "Robust locally weighted regression and smoothing | |
| scatterplots", Journal of the American Statistical Association, December 1979, |
NewerOlder