`L idZgdZGddeZGddeeZGddeZGdd eZGd d eZ Gd d eZ Gdde Z GddeZ GddeZGddeZGddeZGddeZy)z4Custom warnings and errors used across scikit-learn.) ConvergenceWarningDataConversionWarningDataDimensionalityWarningEfficiencyWarningEstimatorCheckFailedWarningFitFailedWarningNotFittedErrorPositiveSpectrumWarningSkipTestWarningUndefinedMetricWarningUnsetMetadataPassedErrorc"eZdZdZfdZxZS)r aException 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@t||||_||_yN)super__init__unrequested_params routed_params)selfmessagerr __class__s X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sklearn/exceptions.pyrz!UnsetMetadataPassedError.__init__(s  !"4*)__name__ __module__ __qualname____doc__r __classcell__)rs@rr r s$++rr ceZdZdZy)raException 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. Nrrrrrrrr.srrceZdZdZy)rzrCustom warning to capture convergence problems .. versionchanged:: 0.18 Moved from sklearn.utils. Nrr rrrrDrrceZdZdZy)raWarning 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. Nrr rrrrLsrrceZdZdZy)raCustom 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. Nrr rrrr^s rrceZdZdZy)ra5Warning 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 Nrr rrrrlsrrceZdZdZy)raaWarning 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. Nrr rrrrwrrceZdZdZy)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. Nrr rrr r srr ceZdZdZy)r zjWarning used when the metric is invalid .. versionchanged:: 0.18 Moved from sklearn.base. Nrr rrr r r"rr ceZdZdZy)r aWarning 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 Nrr rrr r r'rr ceZdZdZdZdZy)InconsistentVersionWarninga4Warning raised when an estimator is unpickled with an 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.||_||_||_yr)estimator_namecurrent_sklearn_versionoriginal_sklearn_version)rr.r/r0s rrz#InconsistentVersionWarning.__init__s-'>$(@%rcVd|jd|jd|jdS)NzTrying 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.r0r/rs r__str__z"InconsistentVersionWarning.__str__sB+D,?,?+@A--./!99:;4 4 rN)rrrrrr3r rrr,r,s A  rr,c 8eZdZdZdededededef dZdZd Z y ) ra 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 exceptionstatusexpected_to_failexpected_to_fail_reasoncX||_||_||_||_||_||_yr) estimatorr5r6r7r8r9)rr;r5r6r7r8r9s rrz$EstimatorCheckFailedWarning.__init__s0#$" 0'>$rc|jrd|jnd}d|jd|jd|d|jS)NzExpected to fail: zNot expected to failzTest z failed for estimator z. Expected to fail reason: z Exception: )r8r9r5r;r6)rexpected_to_fail_strs r__repr__z$EstimatorCheckFailedWarning.__repr__sg$$!!=!= > ?'  DOO$$:4>>:LM((<'=>..) + rc"|jSr)r>r2s rr3z#EstimatorCheckFailedWarning.__str__s}}rN) rrrrstr Exceptionboolrr>r3r rrrrsH.? ?  ?  ??"%?"  rrN)r__all__ ValueErrorr AttributeErrorr UserWarningrrrrRuntimeWarningrr r r r,rr rrrHs: +z+2Z,K$    ~ k[ k     F6+6r