A Fitted Object Should Remember Its Training
Fit Once, Apply the Same Preparation
BOTIE
Machine-learning libraries needed different algorithms to work together without every caller learning a new interface. The scikit-learn team’s 2013 API-design paper described a common arrangement: fit learns from a dataset, while prediction and transformation methods use the resulting state. That consistency lets a preprocessing object and a predictor participate in the same application.
For a centring procedure, the learned state includes the training mean. Later requests should use that stored reference. Relearning a mean from each request would give the same measurement a different meaning whenever its neighbours change. Separate fit and transform methods make the intended distinction visible, and a changed-batch test checks that the implementation actually respects it.