# tf.keras.datasets.boston_housing.load_data

|---|---|
| [![](https://www.tensorflow.org/images/tf_logo_32px.png) TensorFlow 1 version](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/keras/datasets/boston_housing/load_data) | [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/datasets/boston_housing.py#L27-L79) |

Loads the Boston Housing dataset.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.keras.datasets.boston_housing.load_data`](https://www.tensorflow.org/api_docs/python/tf/keras/datasets/boston_housing/load_data)

<br />

    tf.keras.datasets.boston_housing.load_data(
        path='boston_housing.npz', test_split=0.2, seed=113
    )

This is a dataset taken from the StatLib library which is maintained at
Carnegie Mellon University.

Samples contain 13 attributes of houses at different locations around the
Boston suburbs in the late 1970s. Targets are the median values of
the houses at a location (in k$).

The attributes themselves are defined in the
[StatLib website](http://lib.stat.cmu.edu/datasets/boston).

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `path` | path where to cache the dataset locally (relative to \~/.keras/datasets). |
| `test_split` | fraction of the data to reserve as test set. |
| `seed` | Random seed for shuffling the data before computing the test split. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`. <br /> **x_train, x_test**: numpy arrays with shape (num_samples, 13) containing either the training samples (for x_train), or test samples (for y_train) **y_train, y_test**: numpy arrays of shape (num_samples, ) containing the target scalars. The targets are float scalars typically between 10 and 50 that represent the home prices in k$. ||

<br />