O'Reilly logo

IPython Interactive Computing and Visualization Cookbook by Cyrille Rossant

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Predicting who will survive on the Titanic with logistic regression

In this recipe, we will introduce logistic regression, a basic classifier. We will also show how to perform a grid search with cross-validation.

We will apply these techniques on a Kaggle dataset where the goal is to predict survival on the Titanic based on real data.

Tip

Kaggle (www.kaggle.com/competitions) hosts machine learning competitions where anyone can download a dataset, train a model, and test the predictions on the website. The author of the best model might even win a prize! It is a fun way to get started with machine learning.

Getting ready

Download the Titanic dataset from the book's GitHub repository at https://github.com/ipython-books/cookbook-data.

The dataset has been ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required