liveBook · Manning

Dataset split

As explained in Hugging Face in Action

A dataset split is a partition of a dataset designated for a particular stage or purpose in machine-learning workflows.

A dataset split partitions examples by workflow purpose: training fits a model, testing evaluates performance, and unsupervised data supports learning without labels. section 5.1.3

Load one split with Hugging Face Datasets

Use load_dataset("stanfordnlp/imdb", split="train") to download only the training split instead of the complete DatasetDict. section 5.1.3

Inspect split contents before using them:

  • IMDb exposes train and test splits with 25,000 rows each, plus an unsupervised split with 50,000 rows. section 5.1.3
  • Yelp Polarity provides 560,000 training rows and 38,000 test rows, with text and binary label features. section 6.1.1
  • Fine-tuning assigns the train split to training and the test split to evaluation through Trainer. section 6.1.5
from datasets import load_dataset

dataset_id = 'stanfordnlp/imdb'

dataset = load_dataset(dataset_id)  #1
print(dataset)  #2

Run the minimal loading pattern, then inspect the resulting DatasetDict and its named splits. section 5.1.3

How Hugging Face in Action covers it

How deep it goes
Defines split roles, shows row counts and records, and demonstrates selection; it does not explain creating partitions from raw data.
Examples
Demonstrates IMDb and Yelp Polarity datasets, DatasetDict outputs, row inspection, and Trainer dataset assignment.
What it assumes
Assumes basic Python and dataset loading, while teaching split names, purposes, sizes, and record access.
What you can do after
Apply it via Hugging Face Datasets to download, inspect, and assign subsets for training or evaluation.
How it connects
Connects training, evaluation, unsupervised learning, semisupervised learning, and fine-tuning.

Also explained in

Compare how 21 books explain dataset split →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hugging Face in Action. The section links point to the parts of the book it draws on.