AI Blueprint Engine in Action: Purpose-Built Deep Learning for Predicting Survival of the Titanic Disaster

creaidAI
creaidAI
Jun 4, 2018 · 7 min read
Walk-through using the AI Blueprint Engine to generate code for an end-to-end machine learning pipeline including data loading, pre-processing and a deep neural network for the titanic passenger survival prediction project.

Starting the project

Retrieving and preparing data

Output of the code excerpt above, the top rows provide information about columns in the train.csv file, the bottom rows about the test.csv file.
Filling the missing values in the Age and Fare feature columns.
Filling the missing values in the Embarked feature.
Encode the Sex and Embarked features with categorical indices.

Building the model with the AI Blueprint Engine

Setting up the environment

# Create new environment "venv" inside the current
# working directory and activate it.
$ conda create --name venv python=2.7 && source activate venv
# Install packages.
$ pip install -r requirements.txt

Training the model

Running training.py with the default configuration.

Predicting survival of passengers from the test set

cp titanic_ml_from_disaster/inference.py \ 
titanic_ml_from_disaster/inference_kaggle.py
The modified data loading function. We explicitly subtract the column indices by one to highlight the changes.
PassengerId,Survived
892,0
893,1
...
$ python titanic_ml_from_disaster/predict_for_submission.py \
--source_file_1 ./data/test_preprocessed.csv
PassengerId,Survived
892,0
893,0
894,0
...

creaidAI

Written by

creaidAI

Bridging the gap between ease of use and flexibility in artificial intelligence development — https://creaidAI.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade