Databricks ML Associate Practice Question 24: Model Signature Required
Databricks Certified Machine Learning Associate · Test 3 · question 4 of 10
A data scientist logs a scikit-learn model with mlflow.sklearn.log_model(model, name="model") and then tries to register it to the Unity Catalog model ml.churn.scorer. Registration is rejected because the model has no signature. The training features are in the DataFrame X_train and the model's predictions in preds.
What is the correct fix?
Show answer and explanation
Answer:
A model signature is the schema of the model's inputs and outputs, stored in MLmodel alongside the artifact. Unity Catalog requires one, because the signature is what lets the platform validate requests, generate serving schemas and enforce types at inference. infer_signature derives it from an example input and its predictions; passing input_example achieves the same by letting MLflow infer the signature from the sample. The signature is fixed at logging time, so the model must be logged again, nothing about the registration call can add one after the fact.
Option B fixes a permission error the scientist is not getting. The failure names a missing signature, and CREATE MODEL would be required whether or not the signature existed.
Option C names an AutoML configuration parameter and applies it to the wrong operation. primary_metric selects which metric AutoML optimises; it has no bearing on a model's schema.
Option D inverts what autologging does. Autologging sets log_model_signatures=True by default, so it is one of the ways a signature gets attached; disabling it makes the problem more likely, not less.
Reference: MLflow model signatures