
    0Ph                     d   d Z g dZ G d de          Z G d dee          Z G d de          Z G d d	e          Z G d
 de          Z	 G d de          Z
 G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z G d de          ZdS )z4Custom warnings and errors used across scikit-learn.)NotFittedErrorConvergenceWarningDataConversionWarningDataDimensionalityWarningEfficiencyWarningFitFailedWarningSkipTestWarningUndefinedMetricWarningPositiveSpectrumWarningUnsetMetadataPassedErrorEstimatorCheckFailedWarningc                   "     e Zd ZdZ fdZ xZS )r   a  Exception class to raise if a metadata is passed which is not explicitly         requested (metadata=True) or not requested (metadata=False).

    .. versionadded:: 1.3

    Parameters
    ----------
    message : str
        The message

    unrequested_params : dict
        A dictionary of parameters and their values which are provided but not
        requested.

    routed_params : dict
        A dictionary of routed parameters.
    c                f    t                                          |           || _        || _        d S N)super__init__unrequested_paramsrouted_params)selfmessager   r   	__class__s       R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sklearn/exceptions.pyr   z!UnsetMetadataPassedError.__init__(   s1    !!!"4*    )__name__
__module____qualname____doc__r   __classcell__)r   s   @r   r   r      sB         $+ + + + + + + + +r   r   c                       e Zd ZdZdS )r   a  Exception class to raise if estimator is used before fitting.

    This class inherits from both ValueError and AttributeError to help with
    exception handling and backward compatibility.

    Examples
    --------
    >>> from sklearn.svm import LinearSVC
    >>> from sklearn.exceptions import NotFittedError
    >>> try:
    ...     LinearSVC().predict([[1, 2], [2, 3], [3, 4]])
    ... except NotFittedError as e:
    ...     print(repr(e))
    NotFittedError("This LinearSVC instance is not fitted yet. Call 'fit' with
    appropriate arguments before using this estimator."...)

    .. versionchanged:: 0.18
       Moved from sklearn.utils.validation.
    Nr   r   r   r    r   r   r   r   .   s           r   r   c                       e Zd ZdZdS )r   zrCustom warning to capture convergence problems

    .. versionchanged:: 0.18
       Moved from sklearn.utils.
    Nr   r    r   r   r   r   D              r   r   c                       e Zd ZdZdS )r   a  Warning used to notify implicit data conversions happening in the code.

    This warning occurs when some input data needs to be converted or
    interpreted in a way that may not match the user's expectations.

    For example, this warning may occur when the user
        - passes an integer array to a function which expects float input and
          will convert the input
        - requests a non-copying operation, but a copy is required to meet the
          implementation's data-type expectations;
        - passes an input whose shape can be interpreted ambiguously.

    .. versionchanged:: 0.18
       Moved from sklearn.utils.validation.
    Nr   r    r   r   r   r   L   s           r   r   c                       e Zd ZdZdS )r   a  Custom warning to notify potential issues with data dimensionality.

    For example, in random projection, this warning is raised when the
    number of components, which quantifies the dimensionality of the target
    projection space, is higher than the number of features, which quantifies
    the dimensionality of the original source space, to imply that the
    dimensionality of the problem will not be reduced.

    .. versionchanged:: 0.18
       Moved from sklearn.utils.
    Nr   r    r   r   r   r   ^   s        
 
 
 
r   r   c                       e Zd ZdZdS )r   a5  Warning used to notify the user of inefficient computation.

    This warning notifies the user that the efficiency may not be optimal due
    to some reason which may be included as a part of the warning message.
    This may be subclassed into a more specific Warning class.

    .. versionadded:: 0.18
    Nr   r    r   r   r   r   l   s           r   r   c                       e Zd ZdZdS )r   aa  Warning class used if there is an error while fitting the estimator.

    This Warning is used in meta estimators GridSearchCV and RandomizedSearchCV
    and the cross-validation helper function cross_val_score to warn when there
    is an error while fitting the estimator.

    .. versionchanged:: 0.18
       Moved from sklearn.cross_validation.
    Nr   r    r   r   r   r   w              r   r   c                       e Zd ZdZdS )r   zWarning class used to notify the user of a test that was skipped.

    For example, one of the estimator checks requires a pandas import.
    If the pandas package cannot be imported, the test will be skipped rather
    than register as a failure.
    Nr   r    r   r   r   r      s           r   r   c                       e Zd ZdZdS )r	   zjWarning used when the metric is invalid

    .. versionchanged:: 0.18
       Moved from sklearn.base.
    Nr   r    r   r   r	   r	      r"   r   r	   c                       e Zd ZdZdS )r
   a  Warning raised when the eigenvalues of a PSD matrix have issues

    This warning is typically raised by ``_check_psd_eigenvalues`` when the
    eigenvalues of a positive semidefinite (PSD) matrix such as a gram matrix
    (kernel) present significant negative eigenvalues, or bad conditioning i.e.
    very small non-zero eigenvalues compared to the largest eigenvalue.

    .. versionadded:: 0.22
    Nr   r    r   r   r
   r
      r'   r   r
   c                       e Zd ZdZd Zd ZdS )InconsistentVersionWarninga3  Warning raised when an estimator is unpickled with a inconsistent version.

    Parameters
    ----------
    estimator_name : str
        Estimator name.

    current_sklearn_version : str
        Current scikit-learn version.

    original_sklearn_version : str
        Original scikit-learn version.
    c                0    || _         || _        || _        d S r   )estimator_namecurrent_sklearn_versionoriginal_sklearn_version)r   r.   r/   r0   s       r   r   z#InconsistentVersionWarning.__init__   s"     -'>$(@%%%r   c                 8    d| j          d| j         d| j         dS )NzTrying to unpickle estimator z from version z when using version z. This might lead to breaking code or invalid results. Use at your own risk. For more info please refer to:
https://scikit-learn.org/stable/model_persistence.html#security-maintainability-limitations)r.   r0   r/   r   s    r   __str__z"InconsistentVersionWarning.__str__   s@    4D,? 4 4-4 4!94 4 4		
r   N)r   r   r   r   r   r3   r    r   r   r,   r,      s?         A A A

 

 

 

 

r   r,   c            
       :    e Zd ZdZdededededef
dZd Zd	 Z	d
S )r   a  Warning raised when an estimator check from the common tests fails.

    Parameters
    ----------
    estimator : estimator object
        Estimator instance for which the test failed.

    check_name : str
        Name of the check that failed.

    exception : Exception
        Exception raised by the failed check.

    status : str
        Status of the check.

    expected_to_fail : bool
        Whether the check was expected to fail.

    expected_to_fail_reason : str
        Reason for the expected failure.
    
check_name	exceptionstatusexpected_to_failexpected_to_fail_reasonc                Z    || _         || _        || _        || _        || _        || _        d S r   )	estimatorr5   r6   r7   r8   r9   )r   r;   r5   r6   r7   r8   r9   s          r   r   z$EstimatorCheckFailedWarning.__init__   s6     #$" 0'>$$$r   c                 b    | j         r
d| j         nd}d| j         d| j        d| d| j         S )NzExpected to fail: zNot expected to failzTest z failed for estimator z.
Expected to fail reason: z
Exception: )r8   r9   r5   r;   r6   )r   expected_to_fail_strs     r   __repr__z$EstimatorCheckFailedWarning.__repr__   sj     $(?!=???' 	+DO + +4> + +(<+ +.+ +	
r   c                 *    |                                  S r   )r>   r2   s    r   r3   z#EstimatorCheckFailedWarning.__str__   s    }}r   N)
r   r   r   r   str	Exceptionboolr   r>   r3   r    r   r   r   r      s         .? 	?
 ? ? ? "%? ? ? ?"

 

 

    r   r   N)r   __all__
ValueErrorr   AttributeErrorr   UserWarningr   r   r   r   RuntimeWarningr   r   r	   r
   r,   r   r    r   r   <module>rH      s!   : :
  + + + + +z + + +2    Z   ,           K   $              	 	 	 	 	~ 	 	 	    k       [   	 	 	 	 	k 	 	 	 
  
  
  
  
  
  
  
F6 6 6 6 6+ 6 6 6 6 6r   