Fork me on GitHub

This documentation is for scikit-learn version 0.18.dev0Other versions

If you use the software, please consider citing scikit-learn.

sklearn.base.clone

sklearn.base.clone(estimator, safe=True)[source]

Constructs a new 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 fit on any data.

Parameters:

estimator: estimator object, or list, tuple or set of objects :

The estimator or group of estimators to be cloned

safe: boolean, optional :

If safe is false, clone will fall back to a deepcopy on objects that are not estimators.

Previous