What does an MLflow model signature provide when a model is logged with mlflow.sklearn.log_model(model, 'model', signature=signature)?
Select an answer to reveal the explanation.
Short Explanation and Infographic
A model signature is like a typed function contract — it tells anyone calling the model exactly what inputs it expects and what outputs to expect back, enabling automatic validation before inference.
Full explanation below image
Full Explanation
MLflow model signatures define the expected input and output schema using ModelSignature objects: from mlflow.models.signature import infer_signature; signature = infer_signature(X_train, model.predict(X_train)). The signature captures: input schema — column names, data types (e.g., feature1: double, feature2: long), tensor shapes for deep learning models. Output schema — prediction column(s) and their types. Benefits: 1) Runtime validation — when serving via Databricks Model Serving, the endpoint validates incoming requests against the signature, returning clear errors for type mismatches. 2) Documentation — teams understand the model's expected interface. 3) Auto-schema for REST API — the serving endpoint uses the signature to generate API documentation. Signatures do not contain hyperparameters (those are params), credentials, or accuracy certificates.