§
    ¨éUgW  ã                   óh  — d Z ddlZddlZddlmZmZ ddlmZmZm	Z	 ddl
mZ ddlZddlZddlmZ ddlmZmZ d	d
lmZ d	dlmZmZmZmZmZ  eddd¬¦  «        Z ej        e¦  «        Z ee edgdgdgdg eed	dd¬¦  «        g eeddd¬¦  «        gdœd¬¦  «        dddddddœd„¦   «         Z!dS )a:  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 (1997) 291-297.

é    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                 ó8  — t          | ¬¦  «        } t          | ¦  «        st          | ¦  «         t          | d¦  «        }t          |¦  «        sï|st	          d¦  «        ‚t
                               d                     t          j	        | ¦  «        ¦  «         t          t          | ||¬¦  «        }t          j        d|¬¦  «        5 }t          j        |                     d¦  «        d	¬
¦  «        }	g d¢}
|	dd…|
f         }	t!          j        |	|d¬¦  «         ddd¦  «         n# 1 swxY w Y   t%          |¦  «         nt!          j        |¦  «        }	g d¢}|	dd…df         |	dd…dd…f         }}|dd…dfxx         |dd…df         z  cc<   |dd…dfxx         |dd…df         z  cc<   |dd…df         |dd…df         z  |dd…df<   |dz  }t)          d¦  «        }|}|}d}dg}|rt+          d||||¦  «        \  }}}|r||fS t-          ||||||¬¦  «        S )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                      úc/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/sklearn/datasets/_california_housing.pyr9   r9   8   sÿ  € õX ¨	Ð2Ñ2Ô2€IÝ�)ÑÔð Ý�ÑÔÐå˜YÐ(9Ñ:Ô:€HÝ�(ÑÔð ,Ø"ð 	OÝÐMÑNÔNÐNå�ŠØ4×;Ò;½G¼KÈÑSÔSñ	
ô 	
ð 	
õ %ÝØØØð	
ñ 
ô 
ˆõ Œ\˜v¨LÐ9Ñ9Ô9ð 		;¸QÝœ*Ø—’ÐBÑCÔCÈsðñ ô ˆKð
 8Ð7Ð7ˆMØ% a a a¨Ð&6Ô7ˆKåŒK˜ X¸Ð:Ñ:Ô:Ð:ð		;ð 		;ð 		;ñ 		;ô 		;ð 		;ð 		;ð 		;ð 		;ð 		;ð 		;øøøð 		;ð 		;ð 		;ð 		;õ 	ˆ|ÑÔÐÐõ ”k (Ñ+Ô+ˆð	ð 	ð 	€Mð ˜q˜q˜q !˜tÔ$ k°!°!°!°Q°R°R°%Ô&8ˆD€Fð 	ˆˆˆˆAˆ€J€J„J�$�q�q�q˜!�t”*Ñ€J€J�Jð 	ˆˆˆˆAˆ€J€J„J�$�q�q�q˜!�t”*Ñ€J€J�Jð �a�a�a˜�d”˜d 1 1 1 a 4œjÑ(€DˆˆˆˆAˆ�Jð �hÑ€FåÐ/Ñ0Ô0€Eà€AØ€Aà€Eàð€Lð ð 
Ý-Ø&¨¨f°mÀ\ñ
ô 
‰ˆˆq�!ð ð Ø�!ˆtˆåØØØØ!Ø#Øðñ ô ð s   ÃAD"Ä"D&Ä)D&)"Ú__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Ñ	$Ô	$€ð €à˜8 TÐ*Ø )˜{Ø �kØ�KØ�h˜x¨¨D¸Ð@Ñ@Ô@ÐAØ�(˜4  d°9Ð=Ñ=Ô=Ð>ðð ð #'ð
ñ 
ô 
ð ØØØØØ
ðuð uð uð uñ
ô 
ðuð uð urd   