load_linnerud#

sklearn.datasets.load_linnerud(*,return_X_y=False,as_frame=False)[source]#

Load and return the physical exercise Linnerud dataset.

This dataset is suitable for multi-output regression tasks.

Samples total

20

Dimensionality

3 (for both data and target)

Features

integer

Targets

integer

Read more in theUser Guide.

Parameters:
return_X_ybool, default=False

If True, returns(data,target) instead of a Bunch object.See below for more information about thedata andtarget object.

Added in version 0.18.

as_framebool, default=False

If True, the data is a pandas DataFrame including columns withappropriate dtypes (numeric, string or categorical). The target isa pandas DataFrame or Series depending on the number of target columns.Ifreturn_X_y is True, then (data,target) will be pandasDataFrames or Series as described below.

Added in version 0.23.

Returns:
dataBunch

Dictionary-like object, with the following attributes.

data{ndarray, dataframe} of shape (20, 3)

The data matrix. Ifas_frame=True,data will be a pandasDataFrame.

target: {ndarray, dataframe} of shape (20, 3)

The regression targets. Ifas_frame=True,target will bea pandas DataFrame.

feature_names: list

The names of the dataset columns.

target_names: list

The names of the target columns.

frame: DataFrame of shape (20, 6)

Only present whenas_frame=True. DataFrame withdata andtarget.

Added in version 0.23.

DESCR: str

The full description of the dataset.

data_filename: str

The path to the location of the data.

target_filename: str

The path to the location of the target.

Added in version 0.20.

(data, target)tuple ifreturn_X_y is True

Returns a tuple of two ndarrays or dataframe of shape(20,3). Each row represents one sample and each column represents thefeatures inX and a target iny of a given sample.

Added in version 0.18.

Examples

>>>fromsklearn.datasetsimportload_linnerud>>>linnerud=load_linnerud()>>>linnerud.data.shape(20, 3)>>>linnerud.target.shape(20, 3)
On this page

This Page