Ë
    êÿæiF_  ã                   óä   — d Z ddlZddlmZmZ ddlZddlmZ	 ddl
mZmZmZmZmZ ddlmZ ddlmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZmZmZm Z m!Z!  G d„ deee«      Z" G d„ deee«      Z#y)z6Dummy estimators that implement simple rules of thumb.é    N)ÚIntegralÚReal)ÚBaseEstimatorÚClassifierMixinÚMultiOutputMixinÚRegressorMixinÚ_fit_context)Úcheck_random_state)ÚIntervalÚ
StrOptions)Úclass_distribution)Ú_random_choice_csc)Ú_weighted_percentile)Ú_check_sample_weightÚ_num_samplesÚcheck_arrayÚcheck_consistent_lengthÚcheck_is_fittedÚvalidate_datac                   ó¤   ‡ — e Zd ZU dZ eh d£«      gdgeeddgdœZee	d<   ddddœd	„Z
 ed
¬«      dd„«       Zd„ Zd„ Zd„ Zˆ fd„Zdˆ fd„	Zˆ xZS )ÚDummyClassifiera]  DummyClassifier makes predictions that ignore the input features.

    This classifier serves as a simple baseline to compare against other more
    complex classifiers.

    The specific behavior of the baseline is selected with the `strategy`
    parameter.

    All strategies make predictions that ignore the input feature values passed
    as the `X` argument to `fit` and `predict`. The predictions, however,
    typically depend on values observed in the `y` parameter passed to `fit`.

    Note that the "stratified" and "uniform" strategies lead to
    non-deterministic predictions that can be rendered deterministic by setting
    the `random_state` parameter if needed. The other strategies are naturally
    deterministic and, once fit, always return the same constant prediction
    for any value of `X`.

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

    .. versionadded:: 0.13

    Parameters
    ----------
    strategy : {"most_frequent", "prior", "stratified", "uniform",             "constant"}, default="prior"
        Strategy to use to generate predictions.

        * "most_frequent": the `predict` method always returns the most
          frequent class label in the observed `y` argument passed to `fit`.
          The `predict_proba` method returns the matching one-hot encoded
          vector.
        * "prior": the `predict` method always returns the most frequent
          class label in the observed `y` argument passed to `fit` (like
          "most_frequent"). ``predict_proba`` always returns the empirical
          class distribution of `y` also known as the empirical class prior
          distribution.
        * "stratified": the `predict_proba` method randomly samples one-hot
          vectors from a multinomial distribution parametrized by the empirical
          class prior probabilities.
          The `predict` method returns the class label which got probability
          one in the one-hot vector of `predict_proba`.
          Each sampled row of both methods is therefore independent and
          identically distributed.
        * "uniform": generates predictions uniformly at random from the list
          of unique classes observed in `y`, i.e. each class has equal
          probability.
        * "constant": always predicts a constant label that is provided by
          the user. This is useful for metrics that evaluate a non-majority
          class.

          .. versionchanged:: 0.24
             The default value of `strategy` has changed to "prior" in version
             0.24.

    random_state : int, RandomState instance or None, default=None
        Controls the randomness to generate the predictions when
        ``strategy='stratified'`` or ``strategy='uniform'``.
        Pass an int for reproducible output across multiple function calls.
        See :term:`Glossary <random_state>`.

    constant : int or str or array-like of shape (n_outputs,), default=None
        The explicit constant as predicted by the "constant" strategy. This
        parameter is useful only for the "constant" strategy.

    Attributes
    ----------
    classes_ : ndarray of shape (n_classes,) or list of such arrays
        Unique class labels observed in `y`. For multi-output classification
        problems, this attribute is a list of arrays as each output has an
        independent set of possible classes.

    n_classes_ : int or list of int
        Number of label for each output.

    class_prior_ : ndarray of shape (n_classes,) or list of such arrays
        Frequency of each class observed in `y`. For multioutput classification
        problems, this is computed independently for each output.

    n_features_in_ : int
        Number of features seen during :term:`fit`.

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X` has
        feature names that are all strings.

    n_outputs_ : int
        Number of outputs.

    sparse_output_ : bool
        True if the array returned from predict is to be in sparse CSC format.
        Is automatically set to True if the input `y` is passed in sparse
        format.

    See Also
    --------
    DummyRegressor : Regressor that makes predictions using simple rules.

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.dummy import DummyClassifier
    >>> X = np.array([-1, 1, 1, 1])
    >>> y = np.array([0, 1, 1, 1])
    >>> dummy_clf = DummyClassifier(strategy="most_frequent")
    >>> dummy_clf.fit(X, y)
    DummyClassifier(strategy='most_frequent')
    >>> dummy_clf.predict(X)
    array([1, 1, 1, 1])
    >>> dummy_clf.score(X, y)
    0.75
    >   ÚpriorÚuniformÚconstantÚ
stratifiedÚmost_frequentÚrandom_stateú
array-likeN©Ústrategyr   r   Ú_parameter_constraintsr   c                ó.   — || _         || _        || _        y ©Nr   )Úselfr    r   r   s       úb/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/sklearn/dummy.pyÚ__init__zDummyClassifier.__init__œ   s   € Ø ˆŒØ(ˆÔØ ˆ�ó    T©Úprefer_skip_nested_validationc                 ó2  ‡‡— t        | |d¬«       | j                  | _        | j                  dk(  r?t        j                  |«      r*|j                  «       }t        j                  dt        «       t        j                  |«      | _	        | j                  s*t        j                  |«      }t        j                  |«      }|j                  dk(  rt        j                  |d«      }|j                  d   | _        t#        ||«       |�t%        ||«      }| j                  dk(  r~| j&                  €t)        d«      ‚t        j                  t        j                  | j&                  «      d«      Š‰j                  d	   | j                   k7  rt)        d
| j                   z  «      ‚t+        ||«      \  | _        | _        | _        | j                  dk(  r~t3        | j                   «      D ]f  Št5        ˆˆfd„| j,                  ‰   D «       «      rŒ&dj7                  | j&                  | j,                  ‰   j9                  «       «      }t)        |«      ‚ | j                   dk(  r<| j.                  d	   | _        | j,                  d	   | _        | j0                  d	   | _        | S )aÆ  Fit the baseline classifier.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training data.

        y : array-like of shape (n_samples,) or (n_samples, n_outputs)
            Target values.

        sample_weight : array-like of shape (n_samples,), default=None
            Sample weights.

        Returns
        -------
        self : object
            Returns the instance itself.
        T©Úskip_check_arrayr   zªA local copy of the target data has been converted to a numpy array. Predicting on sparse target data with the uniform strategy would not save memory and would be slower.é   ©éÿÿÿÿr-   r   úMConstant target value has to be specified when the constant strategy is used.r   ú0Constant target value should have shape (%d, 1).c              3   ó4   •K  — | ]  }‰‰   d    |k(  –— Œ y­w)r   N© )Ú.0Úcr   Úks     €€r%   Ú	<genexpr>z&DummyClassifier.fit.<locals>.<genexpr>é   s!   øè ø€ ÐIÑ8H°1˜8 A™; q™>¨QÕ.Ñ8Hùs   ƒzrThe constant target value must be present in the training data. You provided constant={}. Possible values are: {}.)r   r    Ú	_strategyÚspÚissparseÚtoarrayÚwarningsÚwarnÚUserWarningÚsparse_output_ÚnpÚasarrayÚ
atleast_1dÚndimÚreshapeÚshapeÚ
n_outputs_r   r   r   Ú
ValueErrorr   Úclasses_Ú
n_classes_Úclass_prior_ÚrangeÚanyÚformatÚtolist)r$   ÚXÚyÚsample_weightÚerr_msgr   r6   s        @@r%   ÚfitzDummyClassifier.fit¡   s!  ù€ ô( 	�d˜A°Õ5àŸ™ˆŒà�>‰>˜YÒ&¬2¯;©;°q¬>Ø—	‘	“ˆAÜ�M‰Mð+ô
 ôô !Ÿk™k¨!›nˆÔà×"Ò"Ü—
‘
˜1“ˆAÜ—‘˜aÓ ˆAà�6‰6�QŠ;Ü—
‘
˜1˜gÓ&ˆAàŸ'™' !™*ˆŒä  1Ô%àÐ$Ü0°ÀÓBˆMà�>‰>˜ZÒ'Ø�}‰}Ð$Ü ð:óð ô
 Ÿ:™:¤b§m¡m°D·M±MÓ&BÀGÓL�Ø—>‘> !Ñ$¨¯©Ò7Ü$ØJØŸ/™/ñ*óð ô
 ?QØˆ}ó?
Ñ;ˆŒ˜œ¨Ô):ð �>‰>˜ZÒ'Ü˜4Ÿ?™?Ö+�ÜÔI¸¿¹ÀaÒ8HÓIÕIð3ç39±6Ø ŸM™M¨4¯=©=¸Ñ+;×+BÑ+BÓ+Dó4ð ô % WÓ-Ð-ð ,ð �?‰?˜aÒØ"Ÿo™o¨aÑ0ˆDŒOØ ŸM™M¨!Ñ,ˆDŒMØ $× 1Ñ 1°!Ñ 4ˆDÔàˆr'   c           	      ó&  — t        | «       t        |«      }t        | j                  «      }| j                  }| j
                  }| j                  }| j                  }| j                  dk(  r|g}|g}|g}|g}| j                  dk(  r#| j                  |«      }| j                  dk(  r|g}| j                  rºd}	| j                  dv r2|D �
cg c]&  }
t        j                  |
j                  «       g«      ‘Œ( }}
n^| j                  dk(  r|}	nL| j                  dk(  rt        d«      ‚| j                  dk(  r#|D �cg c]  }t        j                  |g«      ‘Œ }}t!        |||	| j                  «      }|S | j                  dv rRt        j"                  t%        | j                  «      D �cg c]  }||   ||   j                  «          ‘Œ c}|dg«      }�n| j                  dk(  rZt        j&                  t%        | j                  «      D �cg c]  }||   |   j                  d¬«         ‘Œ c}«      j(                  }nœ| j                  dk(  r\t%        | j                  «      D �cg c]  }||   |j+                  ||   |¬	«         ‘Œ  }}t        j&                  |«      j(                  }n1| j                  dk(  r"t        j"                  | j                  |df«      }| j                  dk(  rt        j,                  «      }S c c}
w c c}w c c}w c c}w c c}w )
a;  Perform classification on test vectors X.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Test data.

        Returns
        -------
        y : array-like of shape (n_samples,) or (n_samples, n_outputs)
            Predicted target values for X.
        r-   r   N)r   r   r   zCSparse target prediction is not supported with the uniform strategyr   ©Úaxis©Úsize)r   r   r
   r   rI   rH   rJ   r   rF   r8   Úpredict_probar?   r@   ÚarrayÚargmaxrG   r   ÚtilerK   ÚvstackÚTÚrandintÚravel)r$   rO   Ú	n_samplesÚrsrI   rH   rJ   r   ÚprobaÚ
class_probÚcpr5   rP   r6   Úrets                  r%   ÚpredictzDummyClassifier.predictü   sè  € ô 	˜Ôô ! “Oˆ	Ü × 1Ñ 1Ó2ˆà—_‘_ˆ
Ø—=‘=ˆØ×(Ñ(ˆØ—=‘=ˆØ�?‰?˜aÒà$˜ˆJØ �zˆHØ(˜>ˆLØ �zˆHà�>‰>˜\Ò)Ø×&Ñ& qÓ)ˆEØ�‰ !Ò#Ø˜�à×ÒØˆJØ�~‰~Ð!;Ñ;Ù>JÓK¹l¸œBŸH™H b§i¡i£k ]Õ3¸l�ÑKà—‘ <Ò/Ø)‘
à—‘ 9Ò,Ü ð:óð ð
 —‘ :Ò-Ù3;Ó<±8¨aœBŸH™H a S�M°8�Ð<ä" 9¨h¸
ÀD×DUÑDUÓVˆAð@ ˆð= �~‰~Ð!;Ñ;Ü—G‘Gô "' t§¡Ô!7óá!7˜Að ! ™ L°¡O×$:Ñ$:Ó$<Ó=Ø!7ñð  �Nó’ð —‘ <Ò/Ü—I‘Iô "' t§¡Ô!7óá!7˜Að ! ™ E¨!¡H§O¡O¸ OÓ$;Ó<Ø!7ñó÷
 ‘!ñ ð —‘ 9Ò,ô # 4§?¡?Ô3óá3˜ð ˜Q‘K §
¡
¨:°a©=¸y 
Ó IÓJØ3ð ð ô —I‘I˜c“N×$Ñ$‘à—‘ :Ò-Ü—G‘G˜DŸM™M¨I°q¨>Ó:�à�‰ !Ò#Ü—H‘H˜Q“K�àˆùò] Lùò =ùòùòùòs   Ã	+K:Ä6K?Æ# LÈ"L	É#Lc                 óP  — t        | «       t        |«      }t        | j                  «      }| j                  }| j
                  }| j                  }| j                  }| j                  dk(  r|g}|g}|g}|g}g }t        | j                  «      D �]€  }	| j                  dk(  rH||	   j                  «       }
t        j                  |||	   ft        j                  ¬«      }d|dd…|
f<   �n| j                  dk(  rt        j                  |df«      ||	   z  }nè| j                  dk(  r7|j!                  d||	   |¬«      }|j#                  t        j                  «      }n¢| j                  d	k(  r3t        j                  |||	   ft        j                  ¬«      }|||	   z  }n`| j                  d
k(  rQt        j$                  ||	   ||	   k(  «      }
t        j                  |||	   ft        j                  ¬«      }d|dd…|
f<   |j'                  «       �Œƒ | j                  dk(  r|d   }|S )aÊ  
        Return probability estimates for the test vectors X.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Test data.

        Returns
        -------
        P : ndarray of shape (n_samples, n_classes) or list of such arrays
            Returns the probability of the sample for each class in
            the model, where classes are ordered arithmetically, for each
            output.
        r-   r   ©Údtypeç      ð?Nr   r   rW   r   r   r   )r   r   r
   r   rI   rH   rJ   r   rF   rK   r8   r[   r@   ÚzerosÚfloat64ÚonesÚmultinomialÚastypeÚwhereÚappend)r$   rO   ra   rb   rI   rH   rJ   r   ÚPr6   ÚindÚouts               r%   rY   zDummyClassifier.predict_probaS  sá  € ô  	˜Ôô ! “Oˆ	Ü × 1Ñ 1Ó2ˆà—_‘_ˆ
Ø—=‘=ˆØ×(Ñ(ˆØ—=‘=ˆØ�?‰?˜aÒà$˜ˆJØ �zˆHØ(˜>ˆLØ �zˆHàˆÜ�t—‘×'ˆAØ�~‰~ Ò0Ø" 1‘o×,Ñ,Ó.�Ü—h‘h 	¨:°a©=Ð9ÄÇÁÔL�Ø!�’A�s�F“Ø—‘ 7Ò*Ü—g‘g˜y¨!˜nÓ-°¸Q±Ñ?‘à—‘ <Ò/Ø—n‘n Q¨°Q©¸i�nÓH�Ø—j‘j¤§¡Ó,‘à—‘ 9Ò,Ü—g‘g˜y¨*°Q©-Ð8ÄÇ
Á
ÔK�Ø�z !‘}Ñ$‘à—‘ :Ò-Ü—h‘h˜x¨™{¨h°q©kÑ9Ó:�Ü—h‘h 	¨:°a©=Ð9ÄÇÁÔL�Ø!�’A�s�F‘à�H‰H�SŽMð+ (ð. �?‰?˜aÒØ�!‘ˆAàˆr'   c                 ó¼   — | j                  |«      }| j                  dk(  rt        j                  |«      S |D �cg c]  }t        j                  |«      ‘Œ c}S c c}w )aÚ  
        Return log probability estimates for the test vectors X.

        Parameters
        ----------
        X : {array-like, object with finite length or shape}
            Training data.

        Returns
        -------
        P : ndarray of shape (n_samples, n_classes) or list of such arrays
            Returns the log probability of the sample for each class in
            the model, where classes are ordered arithmetically for each
            output.
        r-   )rY   rF   r@   Úlog)r$   rO   rc   Úps       r%   Úpredict_log_probaz!DummyClassifier.predict_log_proba’  sN   € ð  ×"Ñ" 1Ó%ˆØ�?‰?˜aÒÜ—6‘6˜%“=Ð á',Ó-¡u !”B—F‘F˜1•I uÑ-Ð-ùÒ-s   ºAc                 óv   •— t         ‰| �  «       }d|j                  _        d|j                  _        d|_        |S ©NT)ÚsuperÚ__sklearn_tags__Ú
input_tagsÚsparseÚclassifier_tagsÚ
poor_scoreÚno_validation©r$   ÚtagsÚ	__class__s     €r%   r}   z DummyClassifier.__sklearn_tags__¨  s7   ø€ Ü‰wÑ'Ó)ˆØ!%ˆ�‰ÔØ*.ˆ×ÑÔ'Ø!ˆÔØˆr'   c                 ól   •— |€!t        j                  t        |«      df¬«      }t        ‰| �  |||«      S )ak  Return the mean accuracy on the given test data and labels.

        In multi-label classification, this is the subset accuracy
        which is a harsh metric since you require for each sample that
        each label set be correctly predicted.

        Parameters
        ----------
        X : None or array-like of shape (n_samples, n_features)
            Test samples. Passing None as test samples gives the same result
            as passing real test samples, since DummyClassifier
            operates independently of the sampled observations.

        y : array-like of shape (n_samples,) or (n_samples, n_outputs)
            True labels for X.

        sample_weight : array-like of shape (n_samples,), default=None
            Sample weights.

        Returns
        -------
        score : float
            Mean accuracy of self.predict(X) w.r.t. y.
        r-   ©rE   ©r@   rl   Úlenr|   Úscore©r$   rO   rP   rQ   r…   s       €r%   rŠ   zDummyClassifier.score¯  s3   ø€ ð2 ˆ9Ü—‘¤ A£¨˜{Ô+ˆAÜ‰w‰}˜Q  =Ó1Ð1r'   r#   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   Ústrr!   ÚdictÚ__annotations__r&   r	   rS   rg   rY   ry   r}   rŠ   Ú__classcell__©r…   s   @r%   r   r   "   sˆ   ø… ñoñf ÒVÓWð
ð (Ð(Ø˜s L°$Ð7ñ$Ð˜Dó ð $+¸Èô !ñ
 °Ô5òXó 6ðXòtUòn=ò~.ô,÷2ñ 2r'   r   c                   óÂ   ‡ — e Zd ZU dZ eh d£«      g eeddd¬«      dg eeddd¬«      d	dgd
œZee	d<   ddddœd„Z
 ed¬«      dd„«       Zdd„Zˆ fd„Zdˆ fd„	Zˆ xZS )ÚDummyRegressoraŸ  Regressor that makes predictions using simple rules.

    This regressor is useful as a simple baseline to compare with other
    (real) regressors. Do not use it for real problems.

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

    .. versionadded:: 0.13

    Parameters
    ----------
    strategy : {"mean", "median", "quantile", "constant"}, default="mean"
        Strategy to use to generate predictions.

        * "mean": always predicts the mean of the training set
        * "median": always predicts the median of the training set
        * "quantile": always predicts a specified quantile of the training set,
          provided with the quantile parameter.
        * "constant": always predicts a constant value that is provided by
          the user.

    constant : int or float or array-like of shape (n_outputs,), default=None
        The explicit constant as predicted by the "constant" strategy. This
        parameter is useful only for the "constant" strategy.

    quantile : float in [0.0, 1.0], default=None
        The quantile to predict using the "quantile" strategy. A quantile of
        0.5 corresponds to the median, while 0.0 to the minimum and 1.0 to the
        maximum.

    Attributes
    ----------
    constant_ : ndarray of shape (1, n_outputs)
        Mean or median or quantile of the training targets or constant value
        given by the user.

    n_features_in_ : int
        Number of features seen during :term:`fit`.

    feature_names_in_ : ndarray of shape (`n_features_in_`,)
        Names of features seen during :term:`fit`. Defined only when `X` has
        feature names that are all strings.

    n_outputs_ : int
        Number of outputs.

    See Also
    --------
    DummyClassifier: Classifier that makes predictions using simple rules.

    Examples
    --------
    >>> import numpy as np
    >>> from sklearn.dummy import DummyRegressor
    >>> X = np.array([1.0, 2.0, 3.0, 4.0])
    >>> y = np.array([2.0, 3.0, 5.0, 10.0])
    >>> dummy_regr = DummyRegressor(strategy="mean")
    >>> dummy_regr.fit(X, y)
    DummyRegressor()
    >>> dummy_regr.predict(X)
    array([5., 5., 5., 5.])
    >>> dummy_regr.score(X, y)
    0.0
    >   ÚmeanÚmedianr   Úquantileg        rk   Úboth)ÚclosedNÚneitherr   )r    r™   r   r!   r—   ©r    r   r™   c                ó.   — || _         || _        || _        y r#   r�   )r$   r    r   r™   s       r%   r&   zDummyRegressor.__init__  s   € Ø ˆŒØ ˆŒØ ˆ�r'   Tr(   c                 óJ  — t        | |d¬«       t        |dd¬«      }t        |«      dk(  rt        d«      ‚|j                  dk(  rt        j                  |d	«      }|j                  d   | _        t        |||«       |�t        ||«      }| j                  d
k(  rt        j                  |d|¬«      | _        �nF| j                  dk(  r5|€t        j                  |d¬«      | _        �nt        ||d¬«      | _        �n| j                  dk(  rZ| j                   €t        d«      ‚| j                   dz  }|€t        j"                  |d|¬«      | _        n­t        |||¬«      | _        n™| j                  dk(  rŠ| j$                  €t'        d«      ‚t        | j$                  g d¢dd¬«      | _        | j                  dk7  rD| j                  j                  d   |j                  d   k7  rt        d|j                  d   z  «      ‚t        j                  | j                  d«      | _        | S )aº  Fit the baseline regressor.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training data.

        y : array-like of shape (n_samples,) or (n_samples, n_outputs)
            Target values.

        sample_weight : array-like of shape (n_samples,), default=None
            Sample weights.

        Returns
        -------
        self : object
            Fitted estimator.
        Tr+   FrP   )Ú	ensure_2dÚ
input_namer   zy must not be empty.r-   r.   r—   )rV   Úweightsr˜   rU   g      I@)Úpercentile_rankr™   z^When using `strategy='quantile', you have to specify the desired quantile in the range [0, 1].g      Y@)rV   Úqr   r0   )ÚcsrÚcscÚcoo)Úaccept_sparser    Úensure_min_samplesr1   )r-   r/   )r   r   r‰   rG   rC   r@   rD   rE   rF   r   r   r    ÚaverageÚ	constant_r˜   r   r™   Ú
percentiler   Ú	TypeError)r$   rO   rP   rQ   r£   s        r%   rS   zDummyRegressor.fit  sê  € ô( 	�d˜A°Õ5ä˜ U°sÔ;ˆÜˆq‹6�QŠ;ÜÐ3Ó4Ð4à�6‰6�QŠ;Ü—
‘
˜1˜gÓ&ˆAØŸ'™' !™*ˆŒä  1 mÔ4àÐ$Ü0°ÀÓBˆMà�=‰=˜FÒ"ÜŸZ™Z¨°¸=ÔIˆDŽNà�]‰]˜hÒ&ØÐ$Ü!#§¡¨1°1Ô!5�–ä!5Ø�}°dô"�–ð �]‰]˜jÒ(Ø�}‰}Ð$Ü ð4óð ð #Ÿm™m¨eÑ3ˆOØÐ$Ü!#§¡¨q°q¸OÔ!L�•ä!5Ø�}°oô"�•ð �]‰]˜jÒ(Ø�}‰}Ð$Üð:óð ô
 )Ø—‘Ú3ØØ#$ô	ˆDŒNð �‰ !Ò#¨¯©×(<Ñ(<¸QÑ(?À1Ç7Á7È1Á:Ò(MÜ ØFÈÏÉÐQRÉÑSóð ô Ÿ™ D§N¡N°GÓ<ˆŒØˆr'   c                 óœ  — t        | «       t        |«      }t        j                  || j                  f| j
                  t        j                  | j
                  «      j                  ¬«      }t        j                  || j                  f«      }| j                  dk(  r*t        j                  |«      }t        j                  |«      }|r||fS |S )a’  Perform classification on test vectors X.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Test data.

        return_std : bool, default=False
            Whether to return the standard deviation of posterior prediction.
            All zeros in this case.

            .. versionadded:: 0.20

        Returns
        -------
        y : array-like of shape (n_samples,) or (n_samples, n_outputs)
            Predicted target values for X.

        y_std : array-like of shape (n_samples,) or (n_samples, n_outputs)
            Standard deviation of predictive distribution of query points.
        ri   r-   )
r   r   r@   ÚfullrF   r«   rZ   rj   rl   r`   )r$   rO   Ú
return_stdra   rP   Úy_stds         r%   rg   zDummyRegressor.predictp  sœ   € ô, 	˜ÔÜ  “Oˆ	ä�G‰GØ˜Ÿ™Ð(Ø�N‰NÜ—(‘(˜4Ÿ>™>Ó*×0Ñ0ô
ˆô
 —‘˜) T§_¡_Ð5Ó6ˆà�?‰?˜aÒÜ—‘˜“ˆAÜ—H‘H˜U“OˆEá'��5ˆzÐ.¨QÐ.r'   c                 óv   •— t         ‰| �  «       }d|j                  _        d|j                  _        d|_        |S r{   )r|   r}   r~   r   Úregressor_tagsr�   r‚   rƒ   s     €r%   r}   zDummyRegressor.__sklearn_tags__–  s7   ø€ Ü‰wÑ'Ó)ˆØ!%ˆ�‰ÔØ)-ˆ×ÑÔ&Ø!ˆÔØˆr'   c                 ól   •— |€!t        j                  t        |«      df¬«      }t        ‰| �  |||«      S )aŽ  Return the coefficient of determination R^2 of the prediction.

        The coefficient R^2 is defined as `(1 - u/v)`, where `u` is the
        residual sum of squares `((y_true - y_pred) ** 2).sum()` and `v` is the
        total sum of squares `((y_true - y_true.mean()) ** 2).sum()`. The best
        possible score is 1.0 and it can be negative (because the model can be
        arbitrarily worse). A constant model that always predicts the expected
        value of y, disregarding the input features, would get a R^2 score of
        0.0.

        Parameters
        ----------
        X : None or array-like of shape (n_samples, n_features)
            Test samples. Passing None as test samples gives the same result
            as passing real test samples, since `DummyRegressor`
            operates independently of the sampled observations.

        y : array-like of shape (n_samples,) or (n_samples, n_outputs)
            True values for X.

        sample_weight : array-like of shape (n_samples,), default=None
            Sample weights.

        Returns
        -------
        score : float
            R^2 of `self.predict(X)` w.r.t. y.
        r-   r‡   rˆ   r‹   s       €r%   rŠ   zDummyRegressor.score�  s3   ø€ ð: ˆ9Ü—‘¤ A£¨˜{Ô+ˆAÜ‰w‰}˜Q  =Ó1Ð1r'   r#   )F)rŒ   r�   rŽ   r�   r   r   r   r!   r‘   r’   r&   r	   rS   rg   r}   rŠ   r“   r”   s   @r%   r–   r–   Í  s‘   ø… ñ?ñD  Ò JÓKÐLÙ˜d C¨°VÔ<¸dÐCá�T˜4 ¨iÔ8ØØð
ñ$Ð˜Dó ð $*°DÀ4ô !ñ
 °Ô5òOó 6ðOób$/ôL÷2ñ 2r'   r–   )$r�   r<   Únumbersr   r   Únumpyr@   Úscipy.sparser   r9   Úsklearn.baser   r   r   r   r	   Úsklearn.utilsr
   Úsklearn.utils._param_validationr   r   Úsklearn.utils.multiclassr   Úsklearn.utils.randomr   Úsklearn.utils.statsr   Úsklearn.utils.validationr   r   r   r   r   r   r   r–   r3   r'   r%   Ú<module>r¿      sb   ðÙ <ó
 ß "ã Ý ÷õ õ -ß @Ý 7Ý 3Ý 4÷÷ ôh2Ð&¨¸ô h2ôVo2Ð% ~°}õ o2r'   