�
B�gR� � � � d Z ddlZddlZddlZddlZddlZddlZddlmZ ddl Z
ddlmZ ddl
mZmZ ddlmZ ddlmZmZ dd lmZmZ dd
lmZ ddlmZ ddlmZmZmZm Z m!Z!m"Z" dd
l#m$Z$ ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- dd�d�Z.dd�d�Z/ G d� dee� � Z0 G d� d� � Z1 G d� d� � Z2 G d� d� � Z3 G d� d� � Z4 G d� de� � Z5 G d� d � � Z6 G d!� d"� � Z7 G d#� d$� � Z8 G d%� d&� � Z9 G d'� d(� � Z: G d)� d*� � Z; G d+� d,� � Z<d-� Z=d.� Z>d/� Z?d0� Z@d1� ZAdS )2z>Base classes for all estimators and various utility functions.� N)�defaultdict� )�__version__)�config_context�
get_config)�InconsistentVersionWarning)�_HTMLDocumentationLinkMixin�estimator_html_repr)�_MetadataRequester�_routing_enabled)�validate_parameter_constraints)�_SetOutputMixin)�ClassifierTags�
RegressorTags�Tags�
TargetTags�TransformerTags�get_tags)� _IS_32BIT)�_check_feature_names�_check_feature_names_in�_check_n_features�_generate_get_feature_names_out�
_is_fitted�check_array�check_is_fitted�
validate_dataT��safec � � t | d� � r(t j | � � s| � � � S t | |�� � S )a� Construct a new unfitted estimator with the same parameters.
Clone does a deep copy of the model in an estimator
without actually copying attached data. It returns a new estimator
with the same parameters that has not been fitted on any data.
.. versionchanged:: 1.3
Delegates to `estimator.__sklearn_clone__` if the method exists.
Parameters
----------
estimator : {list, tuple, set} of estimator instance or a single estimator instance
The estimator or group of estimators to be cloned.
safe : bool, default=True
If safe is False, clone will fall back to a deep copy on objects
that are not estimators. Ignored if `estimator.__sklearn_clone__`
exists.
Returns
-------
estimator : object
The deep copy of the input, an estimator if input is an estimator.
Notes
-----
If the estimator's `random_state` parameter is an integer (or if the
estimator doesn't have a `random_state` parameter), an *exact clone* is
returned: the clone and the original estimator will give the exact same
results. Otherwise, *statistical clone* is returned: the clone might
return different results from the original estimator. More details can be
found in :ref:`randomness`.
Examples
--------
>>> from sklearn.base import clone
>>> from sklearn.linear_model import LogisticRegression
>>> X = [[-1, 0], [0, 1], [0, -1], [1, 0]]
>>> y = [0, 0, 1, 1]
>>> classifier = LogisticRegression().fit(X, y)
>>> cloned_classifier = clone(classifier)
>>> hasattr(classifier, "classes_")
True
>>> hasattr(cloned_classifier, "classes_")
False
>>> classifier is cloned_classifier
False
�__sklearn_clone__r )�hasattr�inspect�isclassr! �_clone_parametrized)� estimatorr s �\/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/sklearn/base.py�cloner( , sN � �b �y�-�.�.� -�w��y�7Q�7Q� -��*�*�,�,�,��y�t�4�4�4�4� c �� �� t | � � }|t u r �fd�| � � � D � � S |t t t
t fv r |�fd�| D � � � � S t | d� � rt | t � � rj�st j
| � � S t | t � � rt d� � �t dt | � � �dt | � � �d�� � �| j
}| � d� � � }|� � � D ]\ }}t |d�
� � ||<