Model serving package
Your task
Organize training and prediction code as a small package. The training function saves a model file, and the prediction function loads that file to predict new samples. What to do: complete train_and_save and load_and_predict. Note: use scikit-learn LogisticRegression. The save path is passed as an argument.
Ground rules
- •Use joblib for save and load.
- •The prediction function does not receive the training data again.
Not required
- •Model registry server.
- •Online API server.
- •Experiment tracking UI.
▶About this challenge
Save and reload a model while keeping the data handling path consistent before prediction.
Serving code needs more than a model file; it also needs the incoming data shape to match what the model expects.
- What does this practice?
- It practices aligning input handling between training and prediction.
- Why does it matter?
- The same model can behave differently when the incoming data shape changes.