A reusable model accepts raw rows and handles its own learned preparation. This practice set mixes the separate preparation steps with complete classification pipelines. The fictional fixtures contain changed values, missing numeric inputs and a category that training has not seen. Keep the selected columns explicit throughout.
Fit imputers and encoders only on the training partition. The full pipeline tasks combine median imputation, standardization, category encoding and logistic regression in one object. Their outputs must be class-1 probabilities, which differ from hard labels. A transform can run successfully while leaking test information into its categories or fill values. There are no new preprocessing methods here; apply the earlier contracts carefully while the source records and requested imputation strategy change.