sklearn.base.clone
-
sklearn.base.clone(estimator, *, safe=True)
[source] -
Constructs 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 yields a new estimator with the same parameters that has not been fitted on any data.
If the estimator’s
random_state
parameter is an integer (or if the estimator doesn’t have arandom_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 yield different results from the original estimator. More details can be found in Controlling randomness.- Parameters
-
-
estimator{list, tuple, set} of estimator instance or a single estimator instance
-
The estimator or group of estimators to be cloned.
-
safebool, default=True
-
If safe is False, clone will fall back to a deep copy on objects that are not estimators.
-
© 2007–2020 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/0.24/modules/generated/sklearn.base.clone.html