What benefit does logging an input_example with mlflow.sklearn.log_model() provide?
Select an answer to reveal the explanation.
Short Explanation and Infographic
An input example is a sample row that gets attached to your model artifact — it documents what format the model expects and powers the 'Try it out' feature in Model Serving.
Full explanation below image
Full Explanation
mlflow.sklearn.log_model(model, 'model', input_example=X_train[:5]) logs the first 5 training rows as a JSON artifact alongside the model. Benefits: 1) API documentation — the Databricks Model Serving UI shows the example in a curl command or JSON input field so users know exactly what format to send. 2) Signature inference — if signature is not explicitly provided, MLflow can infer it from input_example plus the model's prediction on that example. 3) Testing — the example can be used to verify the model loads correctly after serialization. The input_example is stored as a JSON file in the artifact directory. It does NOT store the full training dataset (only a small sample), perform data validation, or trigger retraining. Providing both signature and input_example is best practice for production models.