Databricks-ML-Pro Model Development Practice Question
A machine learning engineer is preparing to deploy a model to production using MLflow Model Registry. They want to ensure that the model can be easily served and that its dependencies are correctly captured. Which TWO actions should they take when logging the model to guarantee that the serving environment can recreate the necessary Python environment? (Choose two.)
⚠ Common exam trap
The trap here is assuming that registering the model or providing a signature automatically captures dependencies, when in fact MLflow requires explicit environment specification for reproducibility.
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 using `mlflow.sklearn.log_model()` with the `pip_requirements` parameter set to a list of pip requirement strings.
To ensure the serving environment can recreate dependencies, you must explicitly specify them when logging the model. Using the `conda_env` parameter with a Conda YAML file or the `pip_requirements` parameter with a list of pip requirements are the two supported ways to capture dependencies. Both methods result in MLflow saving the necessary environment files with the model, which are then used during serving to install the correct packages.
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 using `mlflow.sklearn.log_model()` with the `pip_requirements` parameter set to a list of pip requirement strings.
Why this is correct
The `pip_requirements` parameter allows you to specify a list of pip requirements, which MLflow will use to create a `requirements.txt` file. This is an alternative to Conda and is particularly useful in environments where Conda is not available. It ensures that the serving environment installs the correct packages, though it may not capture non-Python dependencies as comprehensively as Conda.
- ✗
Log the model using `mlflow.sklearn.log_model()` with the `code_path` parameter to include custom transformation code, which also captures all dependencies.
Why it's wrong here
The `code_path` parameter allows you to include additional code files with the model, which is useful for custom transformations. However, it does not automatically capture Python package dependencies. You still need to specify dependencies via Conda or pip requirements. Including code without dependencies may lead to failures if the code imports packages not present in the serving environment.
- ✗
Log the model using `mlflow.sklearn.log_model()` with the `signature` parameter to infer the input schema and automatically generate the environment.
Why it's wrong here
The `signature` parameter defines the input and output schema of the model, which is useful for validation and serving, but it does not capture Python dependencies. MLflow does not generate the environment from the signature; it requires explicit dependency specification or infers from the current environment. This action alone would not guarantee the serving environment can recreate dependencies.
- ✓
Log the model using `mlflow.sklearn.log_model()` with the `conda_env` parameter specifying a Conda environment YAML file that includes all dependencies.
Why this is correct
Specifying a Conda environment YAML via the `conda_env` parameter ensures that MLflow captures the exact dependencies required for the model. When the model is served, MLflow can recreate the environment using this file, guaranteeing that the correct package versions are installed. This is a best practice for reproducibility and avoiding dependency conflicts.
- ✗
Log the model using `mlflow.sklearn.log_model()` with the `registered_model_name` parameter to register the model, which automatically captures the environment.
Why it's wrong here
The `registered_model_name` parameter registers the model in the Model Registry, but it does not capture dependencies. Registration is about versioning and lifecycle management, not environment capture. MLflow still relies on the environment files (Conda or pip) that are logged with the model artifacts. This action alone does not ensure dependency capture.
About these practice questions
Courseiva writes every Databricks-ML-Pro question from scratch — 300 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.