Estimator that wraps a fitted estimator to prevent re-fitting.
This meta-estimator takes an estimator and freezes it, in the sense that calling fit on it has no effect. fit_predict and fit_transform are also disabled. All other methods are delegated to the original estimator and original estimator’s attributes are accessible as well.
This is particularly useful when you have a fitted or a pre-trained model as a transformer in a pipeline, and you’d like pipeline.fit to have no effect on this step.
The estimator which is to be kept frozen.
See also
NoneNo similar entry in the scikit-learn documentation.
>>> from sklearn.datasets import make_classification >>> from sklearn.frozen import FrozenEstimator >>> from sklearn.linear_model import LogisticRegression >>> X, y = make_classification(random_state=0) >>> clf = LogisticRegression(random_state=0).fit(X, y) >>> frozen_clf = FrozenEstimator(clf) >>> frozen_clf.fit(X, y) # No-op FrozenEstimator(estimator=LogisticRegression(random_state=0)) >>> frozen_clf.predict(X) # Predictions from `clf.predict` array(...)
No-op.
As a frozen estimator, calling fit has no effect.
Ignored.
Ignored.
Additional positional arguments. Ignored, but present for API compatibility with self.estimator.
Additional keyword arguments. Ignored, but present for API compatibility with self.estimator.
Returns the instance itself.
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
A MetadataRequest encapsulating routing information.
Get parameters for this estimator.
Returns a {"estimator": estimator} dict. The parameters of the inner estimator are not included.
Ignored.
Parameter names mapped to their values.
Set the parameters of this estimator.
The only valid key here is estimator. You cannot set the parameters of the inner estimator.
Estimator parameters.
This estimator.
© 2007–2025 The scikit-learn developers
Licensed under the 3-clause BSD License.
https://scikit-learn.org/1.6/modules/generated/sklearn.frozen.FrozenEstimator.html