Load and return the boston house-prices dataset (regression).

Samples total 506
Dimensionality 13
Features real, positive
Targets real 5. - 50.
return_X_y : boolean, default=False.

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

New in version 0.18.

data : Bunch

Dictionary-like object, the interesting attributes are: ‘data’, the data to learn, ‘target’, the regression targets, ‘DESCR’, the full description of the dataset, and ‘filename’, the physical location of boston csv dataset (added in version 0.20).

(data, target) : tuple if return_X_y is True

New in version 0.18.


>>> from sklearn.datasets import load_boston
>>> boston = load_boston()
>>> print(
(506, 13)