After some rather intensive courses, one of which was all about coding in Python - using Jupyter notebooks, I kind of got hooked. I continued doing some Python coding because it was, well. fun! If that makes me a geek, so be it. In the end, I wrote several little Python functions that did a lot of what my professor had been asking us to do during the semester, but did it in a much easier way (at least for anyone else who is using the functions). I have uploaded a couple of them here. If you find them at all useful, feel free to credit me. On the other hand, if you find they need reworking, I am also happy to hear about it. Contact me if you have suggestions or problems or want to talk about Pythonic issues!
CAVEAT: I have not gotten all this correct yet - but it is mostly there. Feel free to use and abuse...
The following code was tested on a Jupyter notebook (Anaconda version), and this cleansed version of the Titanic dataset.
Now for the code ...
NOTE on Code: in order to download the code:
- Navigate to this page and the code links on it
- Left click on the link you wish to download
- Click the down arrow icon at the top right of the resulting page
- If you let your mouse hover over the down arrow icon, it should say "download raw file"
- Once you have clicked the download button, the file should be automatically downloaded onto your computer - check your downloads folder
- ALTERNATELY, skip steps 2 - 5 and right-click on the file, choose "Save link as", find the file in your downloads folder
- Train, fit and evaluate different models
- Run other Jupyter notebooks and put resultant timings in Python dictionary
- Create a scatter plot of the cleansed titanic dataset linked to above
- Python version of train, fit, and evaluate function - you can just use the import command and the name of the file
- Python version of the run other notebook and store timings file
- Function to read a file into python/jupyter notebook environment
- Read file and create a correlation matrix and a correlation plot
- Read file like above, but use an internal function call
- Plot the survival rate for passengers on the titanic