Data Science 365

Bring data into actionable insights.

Member-only story

Using Inbuilt Datasets with TensorFlow Datasets (TFDS)

7 min readMar 26, 2023

--

Photo by Frederik Merten on Unsplash

The TensorFlow Datasets (TFDS) library provides ready-to-use, inbuilt datasets for your ML and DL tasks.

Topics included
---------------

1. Installation of TFDS via pip and conda
2. Import convention
3. Getting the list of all available datasets
4. The tfds.load() function
5. Using the info object to unpack more information
6. Loading data as NumPy arrays
7. Custom splits - Split data according to your needs!
8. Visualizing data as a Pandas DataFrame
9. Using the tfds.show_examples() function

TFDS does not directly come with TensorFlow installation. So, a separate installation is needed. It can be installed by running one of the following commands.

  • pip installation:
# Stable version
pip install tensorflow-datasets
  • conda installation:
# Stable version
conda install -c conda-forge tensorflow-datasets

TFDS is available under Apache 2.0 license, meaning that it can be freely used for personal and commercial purposes.

The import convention is as follows.

import tensorflow_datasets as tfds

--

--

Data Science 365
Data Science 365
Rukshan Pramoditha
Rukshan Pramoditha

Written by Rukshan Pramoditha

3,000,000+ Views | BSc in Stats (University of Colombo, Sri Lanka) | Top 50 Data Science, AI/ML Technical Writer on Medium

No responses yet