
    -io                     6   S r SSKrSSKrSSKJrJr  SSKJrJrJ	r	  SSK
Jr  SSKrSSKrSSKJr  SSKJrJr  S	S
KJr  S	SKJrJrJrJrJr  \" SSSS9r\R:                  " \5      r\" \ \S/S/S/S/\" \S	SSS9/\" \SSSS9/S.SS9SSSSSSS.S j5       r!g)a9  California housing dataset.

The original database is available from StatLib

    http://lib.stat.cmu.edu/datasets/

The data contains 20,640 observations on 9 variables.

This dataset contains the average house value as target variable
and the following input variables (features): average income,
housing average age, average rooms, average bedrooms, population,
average occupation, latitude, and longitude in that order.

References
----------

Pace, R. Kelley and Ronald Barry, Sparse Spatial Autoregressions,
Statistics and Probability Letters, 33:291-297, 1997.

    N)IntegralReal)PathLikemakedirsremove)exists   )Bunch)Intervalvalidate_params   )get_data_home)RemoteFileMetadata_convert_data_dataframe_fetch_remote_pkl_filepath
load_descrzcal_housing.tgzz.https://ndownloader.figshare.com/files/5976036@aaa5c9a6afe2225cc2aed2723682ae403280c4a3695a2ddda4ffb5d8215ea681)filenameurlchecksumbooleanleft)closedg        neither)	data_homedownload_if_missing
return_X_yas_frame	n_retriesdelayT)prefer_skip_nested_validationF   g      ?c           	         [        U S9n [        U 5      (       d  [        U 5        [        U S5      n[        U5      (       d  U(       d  [	        S5      e[
        R                  SR                  [        R                  U 5      5        [        [        U UUS9n[        R                  " SUS9 n[        R                  " UR                  S5      S	S
9n	/ SQn
U	SS2U
4   n	[         R"                  " XSS9  SSS5        [%        U5        O[         R&                  " U5      n	/ SQnW	SS2S4   U	SS2SS24   pUSS2S4==   USS2S4   -  ss'   USS2S4==   USS2S4   -  ss'   USS2S4   USS2S4   -  USS2S4'   US-  n[)        S5      nUnUnSnS/nU(       a  [+        SXUU5      u  nnnU(       a  UU4$ [-        UUUUUUS9$ ! , (       d  f       N= f)a  Load the California housing dataset (regression).

==============   ==============
Samples total             20640
Dimensionality                8
Features                   real
Target           real 0.15 - 5.
==============   ==============

Read more in the :ref:`User Guide <california_housing_dataset>`.

Parameters
----------
data_home : str or path-like, default=None
    Specify another download and cache folder for the datasets. By default
    all scikit-learn data is stored in '~/scikit_learn_data' subfolders.

download_if_missing : bool, default=True
    If False, raise an OSError if the data is not locally available
    instead of trying to download the data from the source site.

return_X_y : bool, default=False
    If True, returns ``(data.data, data.target)`` instead of a Bunch
    object.

    .. versionadded:: 0.20

as_frame : bool, default=False
    If True, the data is a pandas DataFrame including columns with
    appropriate dtypes (numeric, string or categorical). The target is
    a pandas DataFrame or Series depending on the number of target_columns.

    .. versionadded:: 0.23

n_retries : int, default=3
    Number of retries when HTTP errors are encountered.

    .. versionadded:: 1.5

delay : float, default=1.0
    Number of seconds between retries.

    .. versionadded:: 1.5

Returns
-------
dataset : :class:`~sklearn.utils.Bunch`
    Dictionary-like object, with the following attributes.

    data : ndarray, shape (20640, 8)
        Each row corresponding to the 8 feature values in order.
        If ``as_frame`` is True, ``data`` is a pandas object.
    target : numpy array of shape (20640,)
        Each value corresponds to the average
        house value in units of 100,000.
        If ``as_frame`` is True, ``target`` is a pandas object.
    feature_names : list of length 8
        Array of ordered feature names used in the dataset.
    DESCR : str
        Description of the California housing dataset.
    frame : pandas DataFrame
        Only present when `as_frame=True`. DataFrame with ``data`` and
        ``target``.

        .. versionadded:: 0.23

(data, target) : tuple if ``return_X_y`` is True
    A tuple of two ndarray. The first containing a 2D array of
    shape (n_samples, n_features) with each row representing one
    sample and each column representing the features. The second
    ndarray of shape (n_samples,) containing the target samples.

    .. versionadded:: 0.20

Notes
-----

This dataset consists of 20,640 samples and 9 features.

Examples
--------
>>> from sklearn.datasets import fetch_california_housing
>>> housing = fetch_california_housing()
>>> print(housing.data.shape, housing.target.shape)
(20640, 8) (20640,)
>>> print(housing.feature_names[0:6])
['MedInc', 'HouseAge', 'AveRooms', 'AveBedrms', 'Population', 'AveOccup']
)r   zcal_housing.pkzz1Data not found and `download_if_missing` is Falsez&Downloading Cal. housing from {} to {})dirnamer    r!   zr:gz)modenamez"CaliforniaHousing/cal_housing.data,)	delimiter)	      r	   r#            r   r   Nr.   )compress)MedIncHouseAgeAveRooms	AveBedrms
PopulationAveOccupLatitude	Longituder   r   r	   r-   r#   r,   g     j@zcalifornia_housing.rstMedHouseValfetch_california_housing)datatargetframetarget_namesfeature_namesDESCR)r   r   r   r   OSErrorloggerinfoformatARCHIVEr   r   tarfileopennploadtxtextractfilejoblibdumpr   loadr   r   r
   )r   r   r   r   r    r!   filepatharchive_pathfcal_housingcolumns_indexr>   r;   r:   descrXyr<   r=   s                      W/var/www/html/venv/lib/python3.13/site-packages/sklearn/datasets/_california_housing.pyr9   r9   8   s   X 	2I)Y(9:H("MNN4;;GKKS	
 %	
 \\vL9Q**BCsK
 8M%a&67KKK: : 	| kk(+	M q!t$k!QR%&8D 	AJ$q!t*J 	AJ$q!t*J add1a4j(DAJ hF/0EAAEL -&m\
q! !t!# s :9s   +AG
G)"__doc__loggingrE   numbersr   r   osr   r   r   os.pathr   rJ   numpyrG   utilsr
   utils._param_validationr   r    r   _baser   r   r   r   r   rD   	getLogger__name__rA   strr9        rU   <module>re      s   0   " ) )     ?   8O 
		8	$ 8T* ){ kKxD@A4d9=> #'
 
u
urd   