Download, explore, and wrangle the Titanic passenger manifest dataset with an eye toward developing a predictive model for survival.
This tutorial is based on the Kaggle Competition, "Predicting Survival Aboard the Titanic"
Licensed under CC BY-SA 3.0 via Wikimedia Commons: "Cd51-1000g" by Boris Lux
Start by cloning this repository.
Anaconda users: you should have everything you need, but if you find you are missing anything, type this into the command line:
conda install <package>
Windows users MUST install scikit-learn via conda install. DO NOT use pip install. It will fail.
Others: make sure the required libraries are installed by using:
pip install -r requirements.txt
Then look inside the data folder and open train.csv to check out the dataset we'll be exploring today.
To start the lab, type the following into the command line: jupyter notebook.
- How to explore a new dataset?
- What to look for in tabular data?
- What visualization tools can you use to help you explore?
- What is the end goal of data wrangling? Why are we even doing this?
- What to clean and how to clean it?
See also:
Baby steps to performing exploratory analysis in Python
Data munging using Pandas
(You will do this portion in the Machine Learning course.)
Welcome back! Navigate to your titanic folder in the command line and then type to get the latest adds to the repo
git pull
Anaconda users: you already have scikit-learn! If you ever find you are missing anything, type this into the command line:
conda install <package>
Everyone else, make sure scikit-learn is installed:
WINDOWS USERS:
conda install scikit-learn
MAC OSX USERS:
pip install -U numpy scipy scikit-learn
LINUX w/ Python 2:
sudo apt-get install build-essential python-dev python-setuptools \
python-numpy python-scipy libatlas-dev libatlas3gf-base
sudo apt-get install python-matplotlib
LINUX w/ Python 3:
sudo apt-get install build-essential python3-dev python3-setuptools \
python3-numpy python3-scipy libatlas-dev libatlas3gf-base
sudo apt-get install python-matplotlib
Problems with installation? Please check out scikit-learn's documentation to learn more.
Machine Learning
Classification
Cross-Validation
http://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html
Model Evaluation
-Classification reports
-Precision recall curves
-Mean squared error
-Coefficient of determination
Linear Regression
http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LinearRegression.html
Random Forests
http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html
Support Vector Machines
http://scikit-learn.org/stable/modules/svm.html
This tutorial is based on the following tutorials for Kaggle's titanic competition: - https://www.kaggle.com/c/titanic/details/getting-started-with-random-forests - https://github.com/savarin/pyconuk-introtutorial/tree/master/notebooks