a
    Sic                     @   s:   d Z ddlZddlmZ ddlmZ eddd	d
ZdS )z(Boston housing price regression dataset.    N)get_file)keras_exportz'keras.datasets.boston_housing.load_databoston_housing.npz皙?q   c                 C   s:  d|  krdk sn J d}t | |d dd} tj| dd }|d	 }|d
 }W d   n1 sd0    Y  tj|}tt|}|| || }|| }t|dt	t|d|   }	t|dt	t|d|   }
t|t	t|d|  d }t|t	t|d|  d }|	|
f||ffS )a  Loads the Boston Housing dataset.

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

    **WARNING:** This dataset has an ethical problem: the authors of this
    dataset included a variable, "B", that may appear to assume that racial
    self-segregation influences house prices. As such, we strongly discourage
    the use of this dataset, unless in the context of illustrating ethical
    issues in data science and machine learning.

    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).

    Args:
      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.

    Returns:
      Tuple of Numpy arrays: `(x_train, y_train), (x_test, y_test)`.

    **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$.
    r      z<https://storage.googleapis.com/tensorflow/tf-keras-datasets/r   Z@f553886a1f8d56431e820c5b82552d9d95cfcb96d1e678153f8839538947dff5)origin	file_hashT)allow_picklexyN)
r   nploadrandomRandomStatearangelenshufflearrayint)pathZ
test_splitseedZorigin_folderfr   r   rngindicesZx_trainZy_trainZx_testZy_test r   Y/var/www/html/django/DPS/env/lib/python3.9/site-packages/keras/datasets/boston_housing.py	load_data   s*    &&
""""r   )r   r   r   )__doc__numpyr   keras.utils.data_utilsr    tensorflow.python.util.tf_exportr   r   r   r   r   r   <module>   s
   