12. Inference & Deployment Checklist
Once the final model is trained and evaluated:
- Retrain on full data (train + validation) before deployment if you used a hold-out val set.
- Save the fitted pipeline (not just the model — you need the scaler/imputer too).
import joblib joblib.dump(pipe, 'model_pipeline.pkl') loaded_pipe = joblib.load('model_pipeline.pkl') - Prediction on new data:
y_pred = loaded_pipe.predict(X_new) y_proba = loaded_pipe.predict_proba(X_new) # for probability scores - Check for distribution shift — monitor whether real-world input features start drifting from the training distribution.
- Calibration — if probabilities matter (not just class labels), check if
predict_probais well-calibrated using a calibration curve. UseCalibratedClassifierCVif needed.