titanic
Stay organized with collections
Save and categorize content based on your preferences.
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 |
FeaturesDict({
'age': float32,
'boat': string,
'body': int32,
'cabin': string,
'embarked': ClassLabel(shape=(), dtype=int64, num_classes=4),
'fare': float32,
'home.dest': string,
'name': string,
'parch': int32,
'pclass': ClassLabel(shape=(), dtype=int64, num_classes=3),
'sex': ClassLabel(shape=(), dtype=int64, num_classes=2),
'sibsp': int32,
'survived': ClassLabel(shape=(), dtype=int64, num_classes=2),
'ticket': string,
})
Feature |
Class |
Shape |
Dtype |
Description |
|
FeaturesDict |
|
|
|
age |
Tensor |
|
float32 |
|
boat |
Tensor |
|
string |
|
body |
Tensor |
|
int32 |
|
cabin |
Tensor |
|
string |
|
embarked |
ClassLabel |
|
int64 |
|
fare |
Tensor |
|
float32 |
|
home.dest |
Tensor |
|
string |
|
name |
Tensor |
|
string |
|
parch |
Tensor |
|
int32 |
|
pclass |
ClassLabel |
|
int64 |
|
sex |
ClassLabel |
|
int64 |
|
sibsp |
Tensor |
|
int32 |
|
survived |
ClassLabel |
|
int64 |
|
ticket |
Tensor |
|
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):
@ONLINE {titanic,
author = "Frank E. Harrell Jr., Thomas Cason",
title = "Titanic dataset",
month = "oct",
year = "2017",
url = "https://www.openml.org/d/40945"
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-02-12 UTC.
[null,null,["Last updated 2023-02-12 UTC."],[],[],null,["# titanic\n\n\u003cbr /\u003e\n\n- **Description**:\n\nDataset describing the survival status of individual passengers on the Titanic.\nMissing values in the original dataset are represented using ?. Float and int\nmissing values are replaced with -1, string missing values are replaced with\n'Unknown'.\n\n- **Homepage** :\n \u003chttps://www.openml.org/d/40945\u003e\n\n- **Source code** :\n [`tfds.datasets.titanic.Builder`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/datasets/titanic/titanic_dataset_builder.py)\n\n- **Versions**:\n\n - `2.0.0`: New split API (\u003chttps://tensorflow.org/datasets/splits\u003e)\n - `3.0.0`: Use a standard flat dictionary of features for the dataset. Use `as_supervised=True` to split the dataset into a `(features_dict,\n survived)` tuple.\n - **`4.0.0`** (default): Fix inverted labels which were inverted in the 3.0.0.\n- **Download size** : `114.98 KiB`\n\n- **Dataset size** : `382.58 KiB`\n\n- **Auto-cached**\n ([documentation](https://www.tensorflow.org/datasets/performances#auto-caching)):\n Yes\n\n- **Splits**:\n\n| Split | Examples |\n|-----------|----------|\n| `'train'` | 1,309 |\n\n- **Feature structure**:\n\n FeaturesDict({\n 'age': float32,\n 'boat': string,\n 'body': int32,\n 'cabin': string,\n 'embarked': ClassLabel(shape=(), dtype=int64, num_classes=4),\n 'fare': float32,\n 'home.dest': string,\n 'name': string,\n 'parch': int32,\n 'pclass': ClassLabel(shape=(), dtype=int64, num_classes=3),\n 'sex': ClassLabel(shape=(), dtype=int64, num_classes=2),\n 'sibsp': int32,\n 'survived': ClassLabel(shape=(), dtype=int64, num_classes=2),\n 'ticket': string,\n })\n\n- **Feature documentation**:\n\n| Feature | Class | Shape | Dtype | Description |\n|-----------|--------------|-------|---------|-------------|\n| | FeaturesDict | | | |\n| age | Tensor | | float32 | |\n| boat | Tensor | | string | |\n| body | Tensor | | int32 | |\n| cabin | Tensor | | string | |\n| embarked | ClassLabel | | int64 | |\n| fare | Tensor | | float32 | |\n| home.dest | Tensor | | string | |\n| name | Tensor | | string | |\n| parch | Tensor | | int32 | |\n| pclass | ClassLabel | | int64 | |\n| sex | ClassLabel | | int64 | |\n| sibsp | Tensor | | int32 | |\n| survived | ClassLabel | | int64 | |\n| ticket | Tensor | | string | |\n\n- **Supervised keys** (See\n [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):\n `({'age': 'age', 'boat': 'boat', 'body': 'body', 'cabin': 'cabin',\n 'embarked': 'embarked', 'fare': 'fare', 'home.dest': 'home.dest', 'name':\n 'name', 'parch': 'parch', 'pclass': 'pclass', 'sex': 'sex', 'sibsp':\n 'sibsp', 'ticket': 'ticket'}, 'survived')`\n\n- **Figure**\n ([tfds.show_examples](https://www.tensorflow.org/datasets/api_docs/python/tfds/visualization/show_examples)):\n Not supported.\n\n- **Examples**\n ([tfds.as_dataframe](https://www.tensorflow.org/datasets/api_docs/python/tfds/as_dataframe)):\n\nDisplay examples... \n\n- **Citation**:\n\n @ONLINE {titanic,\n author = \"Frank E. Harrell Jr., Thomas Cason\",\n title = \"Titanic dataset\",\n month = \"oct\",\n year = \"2017\",\n url = \"https://www.openml.org/d/40945\"\n }"]]