Databricks-ML-Pro Model Development Practice Question
A machine learning engineer is developing a model on Databricks and wants to ensure that the model's input schema is enforced during inference. They are using MLflow to log the model. What should they do?
⚠ Common exam trap
The trap here is thinking that providing an `input_example` alone enforces schema; it only infers a signature if none is provided, and enforcement requires an explicit signature.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Log the model with `mlflow.pyfunc.log_model` and provide a `signature` that includes the input schema.
MLflow's model signature defines the expected input and output schema. When a model is logged with a signature, MLflow can validate input data during inference, ensuring that the schema is enforced. This is the standard and most effective way to enforce input schema, as it leverages built-in functionality without custom code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Log the model with `mlflow.pyfunc.log_model` and provide a `signature` that includes the input schema.
Why this is correct
Providing a `signature` when logging a model with MLflow defines the expected input and output schema. This signature is used by MLflow to validate input data during inference, ensuring that the data types and column names match. It helps catch schema mismatches early and enforces the contract.
- ✗
Log the model with `mlflow.pyfunc.log_model` and include a custom `predict` method that validates the input schema.
Why it's wrong here
While a custom `predict` method can manually validate input, it requires writing additional code and does not leverage MLflow's built-in schema enforcement. This approach is error-prone and not the standard way to enforce input schema. MLflow's signature mechanism is designed for this purpose and is more reliable.
- ✗
Log the model with `mlflow.sklearn.log_model` and set the `input_example` parameter to a sample of the training data.
Why it's wrong here
Setting an `input_example` provides a sample input for the model, which MLflow uses to infer the signature if not explicitly provided. However, it does not enforce the schema during inference; it only records an example. The model will not reject inputs that deviate from the example unless a signature is also provided and enforced.
- ✗
Log the model with `mlflow.sklearn.log_model` and set the `registered_model_name` parameter to register the model in the Model Registry.
Why it's wrong here
Registering the model in the Model Registry does not enforce input schema. The registry manages model versions and stages, not schema validation. While registration is useful for lifecycle management, it does not address the requirement of enforcing input schema during inference.
About these practice questions
One of 300 original Databricks-ML-Pro practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-ML-Pro practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-ML-Pro exam.