Skip to content
Quantoros

Why can the original PCA object remain unfitted when a cached pipeline containing it has been fitted?

Classic MLLevel: IntermediateFitted clone inspection

Why can the original PCA object remain unfitted when a cached pipeline containing it has been fitted?

Hints
  • Object identity can change.
  • The fitted pipeline owns the fitted instance.

Answer

Caching clones intermediate transformers before fitting. Inspect the fitted instance through pipe.named_steps rather than the original Python object.

Source and licence: scikit-learn 1.7.2 — compose · BSD-3-Clause · answer: Quantoros editorial

Related questions