Databricks-ML-Assoc Model Development Practice Question
A machine learning engineer is using MLflow to log a model built with XGBoost. They call mlflow.xgboost.log_model(xgb_model, 'model') and then attempt to load the model in a different environment using mlflow.pyfunc.load_model('runs:/<run_id>/model'). The load fails with an error about missing dependencies. Which action should they take to ensure the model can be loaded in the new environment?
⚠ Common exam trap
The trap here is assuming that model registration or using a native loader solves dependency issues, when the real fix is to include the dependency in the logged environment.
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
✓
They should include the XGBoost library in the conda environment when logging the model, either by passing a custom conda_env or by ensuring the library is installed in the current environment so MLflow can infer it.
When logging a model with MLflow, dependencies are recorded in a conda environment file. If a required library like XGBoost is missing from that file, loading in a new environment fails. Ensuring the library is installed during logging allows MLflow to capture it, or you can specify a custom conda environment. This guarantees the model can be reproduced.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
They should log the model with the registered_model_name parameter to ensure dependencies are captured.
Why it's wrong here
Registering the model does not automatically capture dependencies. The registered_model_name parameter only registers the model in the Model Registry; it does not affect how dependencies are logged. Dependencies are captured in the conda.yaml file when logging the model. Registration is unrelated to resolving missing dependency errors during loading.
- ✗
They should save the model in the ONNX format instead, because ONNX models have no dependencies.
Why it's wrong here
ONNX models still require the ONNX runtime and potentially other libraries to load and execute. While ONNX can improve portability, it does not eliminate dependencies entirely. Moreover, converting to ONNX is not necessary to fix the missing dependency issue; the proper fix is to ensure the conda environment includes XGBoost. ONNX is a different approach and not the direct solution here.
- ✓
They should include the XGBoost library in the conda environment when logging the model, either by passing a custom conda_env or by ensuring the library is installed in the current environment so MLflow can infer it.
Why this is correct
This is correct because MLflow captures dependencies in a conda.yaml file when logging a model. If XGBoost is not included, loading in a new environment will fail. By default, MLflow infers dependencies from the current environment, but if XGBoost was not installed or not detected, it may be missing. Providing a custom conda_env or ensuring XGBoost is installed during logging ensures the dependency is recorded.
- ✗
They should use mlflow.xgboost.load_model() instead of mlflow.pyfunc.load_model(), because the latter does not support XGBoost models.
Why it's wrong here
This is incorrect because mlflow.pyfunc.load_model() does support XGBoost models when they are logged with the pyfunc flavor. By default, mlflow.xgboost.log_model() logs both the native XGBoost flavor and the pyfunc flavor, allowing loading via pyfunc. The error is about missing dependencies, not about lack of support. Using the native loader might still fail if dependencies are missing.
About these practice questions
This Databricks-ML-Assoc question is part of Courseiva's 319-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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-Assoc 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-Assoc exam.