transform vs fit_transform in scikit-learn: The Data-Leakage Rule (and Why You Should Use a Pipeline)
fit vs transform vs fit_transform in scikit-learn, and the rule that prevents data leakage: fit on train only, transform train and test with the training parameters. Plus why a Pipeline is the correct way to enforce this.