diamonds
Stay organized with collections
Save and categorize content based on your preferences.
This classic dataset contains physical attributes and prices of 53940 diamonds.
Attributes:
- price: Price in US dollars.
- carat: Weight of the diamond.
- cut: Cut quality (ordered worst to best).
- color: Color of the diamond (ordered best to worst).
- clarity: Clarity of the diamond (ordered worst to best).
- x: Length in mm.
- y: Width in mm.
- z: Depth in mm.
- depth: Total depth percentage: 100 * z / mean(x, y)
table: Width of the top of the diamond relative to the widest point.
Homepage:
https://ggplot2.tidyverse.org/reference/diamonds.html
Source code:
tfds.structured.diamonds.Diamonds
Versions:
1.0.0
(default): Initial release.
Download size: 2.64 MiB
Dataset size: 13.01 MiB
Auto-cached
(documentation):
Yes
Splits:
Split |
Examples |
'train' |
53,940 |
FeaturesDict({
'features': FeaturesDict({
'carat': float32,
'clarity': ClassLabel(shape=(), dtype=int64, num_classes=8),
'color': ClassLabel(shape=(), dtype=int64, num_classes=7),
'cut': ClassLabel(shape=(), dtype=int64, num_classes=5),
'depth': float32,
'table': float32,
'x': float32,
'y': float32,
'z': float32,
}),
'price': float32,
})
Feature |
Class |
Shape |
Dtype |
Description |
|
FeaturesDict |
|
|
|
features |
FeaturesDict |
|
|
|
features/carat |
Tensor |
|
float32 |
|
features/clarity |
ClassLabel |
|
int64 |
|
features/color |
ClassLabel |
|
int64 |
|
features/cut |
ClassLabel |
|
int64 |
|
features/depth |
Tensor |
|
float32 |
|
features/table |
Tensor |
|
float32 |
|
features/x |
Tensor |
|
float32 |
|
features/y |
Tensor |
|
float32 |
|
features/z |
Tensor |
|
float32 |
|
price |
Tensor |
|
float32 |
|
@Book{,
author = {Hadley Wickham},
title = {ggplot2: Elegant Graphics for Data Analysis},
publisher = {Springer-Verlag New York},
year = {2016},
isbn = {978-3-319-24277-4},
url = {https://ggplot2.tidyverse.org},
}
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 2022-11-23 UTC.
[null,null,["Last updated 2022-11-23 UTC."],[],[],null,["# diamonds\n\n\u003cbr /\u003e\n\n- **Description**:\n\nThis classic dataset contains physical attributes and prices of 53940 diamonds.\n\nAttributes:\n\n- price: Price in US dollars.\n- carat: Weight of the diamond.\n- cut: Cut quality (ordered worst to best).\n- color: Color of the diamond (ordered best to worst).\n- clarity: Clarity of the diamond (ordered worst to best).\n- x: Length in mm.\n- y: Width in mm.\n- z: Depth in mm.\n- depth: Total depth percentage: 100 \\* z / mean(x, y)\n- table: Width of the top of the diamond relative to the widest point.\n\n- **Homepage** :\n \u003chttps://ggplot2.tidyverse.org/reference/diamonds.html\u003e\n\n- **Source code** :\n [`tfds.structured.diamonds.Diamonds`](https://github.com/tensorflow/datasets/tree/master/tensorflow_datasets/structured/diamonds/diamonds.py)\n\n- **Versions**:\n\n - **`1.0.0`** (default): Initial release.\n- **Download size** : `2.64 MiB`\n\n- **Dataset size** : `13.01 MiB`\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'` | 53,940 |\n\n- **Feature structure**:\n\n FeaturesDict({\n 'features': FeaturesDict({\n 'carat': float32,\n 'clarity': ClassLabel(shape=(), dtype=int64, num_classes=8),\n 'color': ClassLabel(shape=(), dtype=int64, num_classes=7),\n 'cut': ClassLabel(shape=(), dtype=int64, num_classes=5),\n 'depth': float32,\n 'table': float32,\n 'x': float32,\n 'y': float32,\n 'z': float32,\n }),\n 'price': float32,\n })\n\n- **Feature documentation**:\n\n| Feature | Class | Shape | Dtype | Description |\n|------------------|--------------|-------|---------|-------------|\n| | FeaturesDict | | | |\n| features | FeaturesDict | | | |\n| features/carat | Tensor | | float32 | |\n| features/clarity | ClassLabel | | int64 | |\n| features/color | ClassLabel | | int64 | |\n| features/cut | ClassLabel | | int64 | |\n| features/depth | Tensor | | float32 | |\n| features/table | Tensor | | float32 | |\n| features/x | Tensor | | float32 | |\n| features/y | Tensor | | float32 | |\n| features/z | Tensor | | float32 | |\n| price | Tensor | | float32 | |\n\n- **Supervised keys** (See\n [`as_supervised` doc](https://www.tensorflow.org/datasets/api_docs/python/tfds/load#args)):\n `('features', 'price')`\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 @Book{,\n author = {Hadley Wickham},\n title = {ggplot2: Elegant Graphics for Data Analysis},\n publisher = {Springer-Verlag New York},\n year = {2016},\n isbn = {978-3-319-24277-4},\n url = {https://ggplot2.tidyverse.org},\n }"]]