
     h                          d dl mZ d ZddZdS )   )is_classifierc                 h   |dvrt          d          d}|dk    rAt          | |d          }|-t          |                    || j        j                            nUt          | dd          }t          | dd          }|p|}|-t          |                    d| j        j                            |S )	a)  Return prediction method from the response_method

    Parameters
    ----------
    estimator: object
        Classifier to check

    response_method: {'auto', 'predict_proba', 'decision_function'}
        Specifies whether to use :term:`predict_proba` or
        :term:`decision_function` as the target response. If set to 'auto',
        :term:`predict_proba` is tried first and if it does not exist
        :term:`decision_function` is tried next.

    Returns
    -------
    prediction_method: callable
        prediction method of estimator
    )predict_probadecision_functionautozFresponse_method must be 'predict_proba', 'decision_function' or 'auto'z'response method {} is not defined in {}r   Nr   r   z"decision_function or predict_proba)
ValueErrorgetattrformat	__class____name__)	estimatorresponse_method	error_msgprediction_methodr   r   s         V/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/sklearn/metrics/_plot/base.py!_check_classifier_response_methodr      s    ( LLLT
 
 	
 :I&  #IEE$  )2E2NOO   %
  	?DAA#I/BDII)>->$  8):M:V        Nc           	      8   d|j         j         }t          |          st          |          t	          ||          } ||           }|h	 |j                                                            |          }nI# t          $ r-}t          d| dt          |j                             |d}~ww xY wd}|j        |         }|j	        dk    r5|j
        d         }	|	dk    rt          | d|	 d          |dd|f         }n||j        d	         k    r|d
z  }||fS )ai  Return response and positive label.

    Parameters
    ----------
    X : {array-like, sparse matrix} of shape (n_samples, n_features)
        Input values.

    estimator : estimator instance
        Fitted classifier or a fitted :class:`~sklearn.pipeline.Pipeline`
        in which the last estimator is a classifier.

    response_method: {'auto', 'predict_proba', 'decision_function'}
        Specifies whether to use :term:`predict_proba` or
        :term:`decision_function` as the target response. If set to 'auto',
        :term:`predict_proba` is tried first and if it does not exist
        :term:`decision_function` is tried next.

    pos_label : str or int, default=None
        The class considered as the positive class when computing
        the metrics. By default, `estimators.classes_[1]` is
        considered as the positive class.

    Returns
    -------
    y_pred: ndarray of shape (n_samples,)
        Target scores calculated from the provided response_method
        and pos_label.

    pos_label: str or int
        The class considered as the positive class when computing
        the metrics.
    z8Expected 'estimator' to be a binary classifier, but got Nz2The class provided by 'pos_label' is unknown. Got z instead of one of       z fit on multiclass (z classes) data    )r   r   r   r   r   classes_tolistindexsetndimshape)
Xr   r   	pos_labelclassification_errorr   y_pred	class_idxey_pred_shapes
             r   _get_responser&   2   s   D	+(	+ 	+ 
 ## /-...9)_UUq!!F	!*113399)DDII 	 	 	KK K14Y5G1H1HK K  	 	&y1	{a|A1'  \      9%	i(+	+	+"9s   ,A9 9
B0(B++B0)N)baser   r   r&    r   r   <module>r)      sK    ! ! ! ! ! !+ + +\B B B B B Br   