• Description:

Dataset describing the survival status of individual passengers on the Titanic. Missing values in the original dataset are represented using ?. Float and int missing values are replaced with -1, string missing values are replaced with 'Unknown'.

Split Examples
'train' 1,309
  • Feature structure:
    'age': tf.float32,
    'boat': tf.string,
    'body': tf.int32,
    'cabin': tf.string,
    'embarked': ClassLabel(shape=(), dtype=tf.int64, num_classes=4),
    'fare': tf.float32,
    'home.dest': tf.string,
    'name': tf.string,
    'parch': tf.int32,
    'pclass': ClassLabel(shape=(), dtype=tf.int64, num_classes=3),
    'sex': ClassLabel(shape=(), dtype=tf.int64, num_classes=2),
    'sibsp': tf.int32,
    'survived': ClassLabel(shape=(), dtype=tf.int64, num_classes=2),
    'ticket': tf.string,
  • Feature documentation:
Feature Class Shape Dtype Description
age Tensor tf.float32
boat Tensor tf.string
body Tensor tf.int32
cabin Tensor tf.string
embarked ClassLabel tf.int64
fare Tensor tf.float32
home.dest Tensor tf.string
name Tensor tf.string
parch Tensor tf.int32
pclass ClassLabel tf.int64
sex ClassLabel tf.int64
sibsp Tensor tf.int32
survived ClassLabel tf.int64
ticket Tensor tf.string
  • Supervised keys (See as_supervised doc): ({'age': 'age', 'boat': 'boat', 'body': 'body', 'cabin': 'cabin', 'embarked': 'embarked', 'fare': 'fare', 'home.dest': 'home.dest', 'name': 'name', 'parch': 'parch', 'pclass': 'pclass', 'sex': 'sex', 'sibsp': 'sibsp', 'ticket': 'ticket'}, 'survived')

  • Figure (tfds.show_examples): Not supported.

  • Examples (tfds.as_dataframe):

  • Citation:
@ONLINE {titanic,
author = "Frank E. Harrell Jr., Thomas Cason",
title  = "Titanic dataset",
month  = "oct",
year   = "2017",
url    = "https://www.openml.org/d/40945"