liveBook · Manning

Stratified sampling

Also called stratification

Stratified sampling is a method that divides a population into defined subgroups and samples from each to control their representation.

How 4 Manning books explain it

Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI

A sampling method that divides a population into subgroups and samples from each subgroup.

How it is used
Uses stratification to direct annotation toward diverse or important groups that might otherwise be overlooked.
How deep it goes
Explains subgroup quotas and within-group selection with worked examples, while leaving demographic implementation without separate code.
Examples
Illustrates confidence intervals in object detection, weighted labels in semantic segmentation, and label groups in part-of-speech tagging.
What you can do after
Practice selecting quotas and sampling methods for demographic, confidence, or label groups.

Read how Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI explains stratified sampling →

Machine Learning System Design

Stratification is a sampling technique that divides data into groups and controls the amount selected from each group.

How it is used
Supports validation design, subgroup representation, and efficient sampling for large, imbalanced, or duplicate-heavy datasets.
How deep it goes
Defines group-based sampling and selection priorities, but does not detail algorithms or validation procedures.
Examples
Uses cross-country customer representation and fresh-versus-old temporal groups as concrete sampling cases.
What you can do after
Apply stratification by defining subgroups and controlling each group’s contribution to training or test data.

Read how Machine Learning System Design explains stratified sampling →

Build AI Drug Discovery Pipelines

Stratified sampling partitions data while preserving specified class or label distributions across the resulting subsets.

How it is used
Uses representative train-test splits for multilabel CYP inhibitor prediction.
How deep it goes
Explains label preservation and demonstrates implementation, but stops short of mathematical derivation.
Examples
Uses five CYP inhibitor labels, 4,805 shared molecules, and IterativeStratification.
What you can do after
Apply it via IterativeStratification to construct representative multilabel training and test sets.

Read how Build AI Drug Discovery Pipelines explains stratified sampling →

Inside Deep Learning: Math, Algorithms, Models

A sampling method that preserves class proportions across data splits or samples.

How it is used
Preserves class proportions when creating train/test splits to reduce misleading impressions of model performance.
How deep it goes
Explains preserving class ratios and why it matters, but leaves class-imbalance remedies largely untreated.
Examples
Illustrates 99-to-1 class ratios, a cancer-prediction scenario, and a language-name classifier split.
What you can do after
Apply stratified splitting by selecting a test set that preserves each class’s dataset proportion.

Read how Inside Deep Learning: Math, Algorithms, Models explains stratified sampling →

Also covered in

What to know first

Related concepts

Questions about stratified sampling

What is stratified sampling?

Stratified sampling is a method that divides a population into defined subgroups and samples from each to control their representation.

Which Manning books explain stratified sampling?

Human-in-the-Loop Machine Learning: Active learning and annotation for human-centered AI, Machine Learning System Design, Build AI Drug Discovery Pipelines and Inside Deep Learning: Math, Algorithms, Models.

What should I know before learning stratified sampling?

Manning books that teach stratified sampling usually introduce accuracy, f-score, precision and recall first.

What is stratified sampling a kind of?

Stratified sampling is a kind of sampling. Sampling is a procedure for selecting items from a collection or generating outcomes from a probability distribution according to a specified rule.

What is stratified sampling also called?

Stratified sampling is also called stratification.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.