How to Load the Linnerud Dataset in Python with scikit-learn
Most datasets have one thing to predict. The Linnerud dataset has three: from 20 people's exercise counts, predict their weight, waist and pulse together. That makes it the small built-in dataset for multi-output regression. This guide loads it with load_linnerud, with real output from scikit-learn 1.9.1.
Syntax
from sklearn.datasets import load_linnerud
<dataset> = load_linnerud(as_frame=True)
X, y = load_linnerud(return_X_y=True, as_frame=True)
| Part | What it means |
|---|---|
<dataset>.data | The three exercises: Chins, Situps and Jumps |
<dataset>.target | The three values to predict: Weight, Waist and Pulse |
<dataset>.frame | Both tables side by side in one DataFrame |
The scikit-learn reference: "Load and return the physical exercise Linnerud dataset. This dataset is suitable for multi-output regression tasks."
Prerequisites
- scikit-learn and pandas in your project, for example with
uv add scikit-learn pandas. This guide uses scikit-learn 1.9.1 and pandas 3.1.1 on Python 3.15.2.
Step 1: Write the Script
from sklearn.datasets import load_linnerud
linnerud = load_linnerud(as_frame=True)
print(linnerud.data.shape, linnerud.target.shape)
print(linnerud.feature_names)
print(linnerud.target_names)
print(linnerud.frame.head(3))

Step 2: Run It
uv run python load_linnerud_demo.py
(20, 3) (20, 3)
['Chins', 'Situps', 'Jumps']
['Weight', 'Waist', 'Pulse']
Chins Situps Jumps Weight Waist Pulse
0 5.0 162.0 60.0 191.0 36.0 50.0
1 2.0 110.0 60.0 189.0 37.0 52.0
2 12.0 101.0 101.0 193.0 38.0 58.0

Twenty people, three exercises in, three measurements out.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Expecting y to be one column | It's a DataFrame with three columns: Weight, Waist and Pulse | Use a model that predicts several outputs, or pick one column, such as y["Weight"] |
| Judging a model on 20 rows | A test set from 20 rows has only a handful of people | Use it to learn the API, not to compare models |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
linnerud.frame is None | Loaded without as_frame=True: load_linnerud().frame printed None | Load it again with as_frame=True |
FAQ
Is y a Series like in other datasets?
No: load_linnerud(return_X_y=True, as_frame=True) gave a DataFrame for y, with the columns Weight, Waist and Pulse.
Which models can predict all three at once?
Several scikit-learn regressors accept a target with several columns. LinearRegression, fitted on X and the three-column y, predicted three numbers per person: [176.2 35.1 57.1] for the first.
Conclusion
load_linnerud(as_frame=True) loaded 20 people with three exercises as the data and three body measurements as the target: a small dataset for predicting several numbers at once.
Additional Resources
- load_linnerud — the function.
- Toy datasets — the Linnerud dataset's description.
