§
    qŠtj—  ã                   óp   — d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d„ Z G d„ d	e¦  «        Zd
S )é    )Údeepcopy)ÚBaseEstimator)ÚNotFittedError)Úget_tags)Úavailable_if)Úcheck_is_fittedc                 ó   ‡ — ˆ fd„}|S )zSCheck that final_estimator has `attr`.

    Used together with `available_if`.
    c                 ó2   •— t          | j        ‰¦  «         dS ©NT)ÚgetattrÚ	estimator)ÚselfÚattrs    €úT/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sklearn/frozen/_frozen.pyÚcheckz_estimator_has.<locals>.check   s   ø€ å�” Ñ%Ô%Ð%Øˆtó    © )r   r   s   ` r   Ú_estimator_hasr      s#   ø€ ðð ð ð ð ð
 €Lr   c                   ó~   — e Zd ZdZd„ Z e ed¦  «        ¦  «        d„ ¦   «         Zd„ Zd„ Z	d„ Z
d„ Zd	„ Zdd„Zd„ ZdS )ÚFrozenEstimatoraö  Estimator that wraps a fitted estimator to prevent re-fitting.

    This meta-estimator takes an estimator and freezes it, in the sense that calling
    `fit` on it has no effect. `fit_predict` and `fit_transform` are also disabled.
    All other methods are delegated to the original estimator and original estimator's
    attributes are accessible as well.

    This is particularly useful when you have a fitted or a pre-trained model as a
    transformer in a pipeline, and you'd like `pipeline.fit` to have no effect on this
    step.

    Parameters
    ----------
    estimator : estimator
        The estimator which is to be kept frozen.

    See Also
    --------
    None: No similar entry in the scikit-learn documentation.

    Examples
    --------
    >>> from sklearn.datasets import make_classification
    >>> from sklearn.frozen import FrozenEstimator
    >>> from sklearn.linear_model import LogisticRegression
    >>> X, y = make_classification(random_state=0)
    >>> clf = LogisticRegression(random_state=0).fit(X, y)
    >>> frozen_clf = FrozenEstimator(clf)
    >>> frozen_clf.fit(X, y)  # No-op
    FrozenEstimator(estimator=LogisticRegression(random_state=0))
    >>> frozen_clf.predict(X)  # Predictions from `clf.predict`
    array(...)
    c                 ó   — || _         d S ©N©r   )r   r   s     r   Ú__init__zFrozenEstimator.__init__>   s   € Ø"ˆŒˆˆr   Ú__getitem__c                 ó&   —  | j         j        |i |¤ŽS )zƒ__getitem__ is defined in :class:`~sklearn.pipeline.Pipeline` and             :class:`~sklearn.compose.ColumnTransformer`.
        )r   r   )r   ÚargsÚkwargss      r   r   zFrozenEstimator.__getitem__A   s   € ð
 *ˆtŒ~Ô)¨4Ð:°6Ð:Ð:Ð:r   c                 óX   — |dv rt          |› d�¦  «        ‚t          | j        |¦  «        S )N)Úfit_predictÚfit_transformz( is not available for frozen estimators.)ÚAttributeErrorr   r   )r   Únames     r   Ú__getattr__zFrozenEstimator.__getattr__H   s9   € ð Ð3Ð3Ð3Ý  DÐ!RÐ!RÐ!RÑSÔSÐSÝ�t”~ tÑ,Ô,Ð,r   c                 ó   — | S r   r   ©r   s    r   Ú__sklearn_clone__z!FrozenEstimator.__sklearn_clone__O   s   € Øˆr   c                 óR   — 	 t          | j        ¦  «         dS # t          $ r Y dS w xY w)NTF)r   r   r   r&   s    r   Ú__sklearn_is_fitted__z%FrozenEstimator.__sklearn_is_fitted__R   s>   € ð	Ý˜DœNÑ+Ô+Ð+Ø�4øÝð 	ð 	ð 	Ø�5�5ð	øøøs   ‚ ˜
&¥&c                 ó.   — t          | j        ¦  «         | S )aG  No-op.

        As a frozen estimator, calling `fit` has no effect.

        Parameters
        ----------
        X : object
            Ignored.

        y : object
            Ignored.

        *args : tuple
            Additional positional arguments. Ignored, but present for API compatibility
            with `self.estimator`.

        **kwargs : dict
            Additional keyword arguments. Ignored, but present for API compatibility
            with `self.estimator`.

        Returns
        -------
        self : object
            Returns the instance itself.
        )r   r   )r   ÚXÚyr   r   s        r   ÚfitzFrozenEstimator.fitY   s   € õ4 	˜œÑ'Ô'Ð'Øˆr   c                 óf   — |                      dd¦  «        }|�|| _        |rt          d¦  «        ‚dS )aZ  Set the parameters of this estimator.

        The only valid key here is `estimator`. You cannot set the parameters of the
        inner estimator.

        Parameters
        ----------
        **kwargs : dict
            Estimator parameters.

        Returns
        -------
        self : FrozenEstimator
            This estimator.
        r   NzÆYou cannot set parameters of the inner estimator in a frozen estimator since calling `fit` has no effect. You can use `frozenestimator.estimator.set_params` to set parameters of the inner estimator.)Úpopr   Ú
ValueError)r   r   r   s      r   Ú
set_paramszFrozenEstimator.set_paramsv   sM   € ð  —J’J˜{¨DÑ1Ô1ˆ	ØÐ Ø&ˆDŒNØð 	Ýðñô ð ð	ð 	r   Tc                 ó   — d| j         iS )ah  Get parameters for this estimator.

        Returns a `{"estimator": estimator}` dict. The parameters of the inner
        estimator are not included.

        Parameters
        ----------
        deep : bool, default=True
            Ignored.

        Returns
        -------
        params : dict
            Parameter names mapped to their values.
        r   r   )r   Údeeps     r   Ú
get_paramszFrozenEstimator.get_params‘   s   € ð  ˜Tœ^Ð,Ð,r   c                 óV   — t          t          | j        ¦  «        ¦  «        }d|_        |S r   )r   r   r   Ú
_skip_test)r   Útagss     r   Ú__sklearn_tags__z FrozenEstimator.__sklearn_tags__£   s%   € Ý� ¤Ñ0Ô0Ñ1Ô1ˆØˆŒØˆr   N)T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r$   r'   r)   r-   r1   r4   r8   r   r   r   r   r      sÌ   € € € € € ð ð  ðD#ð #ð #ð €\�.�. Ñ/Ô/Ñ0Ô0ð;ð ;ñ 1Ô0ð;ð-ð -ð -ðð ð ðð ð ðð ð ð:ð ð ð6-ð -ð -ð -ð$ð ð ð ð r   r   N)Úcopyr   Úsklearn.baser   Úsklearn.exceptionsr   Úsklearn.utilsr   Úsklearn.utils.metaestimatorsr   Úsklearn.utils.validationr   r   r   r   r   r   ú<module>rC      sÀ   ðð Ð Ð Ð Ð Ð à &Ð &Ð &Ð &Ð &Ð &Ø -Ð -Ð -Ð -Ð -Ð -Ø "Ð "Ð "Ð "Ð "Ð "Ø 5Ð 5Ð 5Ð 5Ð 5Ð 5Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4ðð ð ðKð Kð Kð Kð K�mñ Kô Kð Kð Kð Kr   