Databricks-ML-Pro ML Ops Practice Question
A financial institution has deployed a credit risk model to a Databricks Model Serving endpoint. The model was trained on data that includes sensitive customer attributes. The compliance team requires that all predictions be explainable and that the model's decisions can be audited. The data science team wants to use SHAP (SHapley Additive exPlanations) to generate explanations for each prediction. Which approach should they take to integrate SHAP with the serving endpoint while maintaining low latency?
⚠ Common exam trap
The trap here is assuming that SHAP explanations can be precomputed or automatically logged, when in reality they must be computed at inference time for each request to provide accurate, real-time explanations.
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
✓
Use the `shap.Explainer` within a custom PyFunc model that computes SHAP values on the fly and returns them alongside predictions.
Integrating SHAP into a custom PyFunc model allows the serving endpoint to return both predictions and explanations in real time. This satisfies the compliance need for per-prediction explainability and auditability. While it introduces some latency, it can be optimized with efficient SHAP algorithms and careful resource allocation, making it suitable for real-time serving in regulated environments.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Enable automatic logging of SHAP values by setting the `log_explainer` parameter in the MLflow model signature.
Why it's wrong here
MLflow does not have a `log_explainer` parameter in the model signature. While MLflow supports logging models with explanations, there is no automatic SHAP logging feature triggered by a signature parameter. This is a fictitious option. SHAP integration requires custom code or a framework like SHAP to compute explanations, not a simple configuration flag.
- ✓
Use the `shap.Explainer` within a custom PyFunc model that computes SHAP values on the fly and returns them alongside predictions.
Why this is correct
Wrapping the model in a custom PyFunc that computes SHAP values at inference time allows explanations to be generated for each request. While this adds latency, it can be optimized by using efficient SHAP implementations and limiting the number of background samples. This approach provides real-time explanations and can be deployed to Model Serving. It meets the requirement for per-prediction explainability and auditability, though latency must be managed.
- ✗
Deploy a separate endpoint that runs SHAP explanations asynchronously and return a job ID that the client can poll for results.
Why it's wrong here
Asynchronous explanation generation decouples the explanation from the prediction, which may not satisfy compliance requirements for immediate explainability. Polling introduces complexity and delay, and the explanation may not be available at the time of decision. This approach is better suited for batch or offline use cases, not for real-time serving where explanations are needed alongside predictions.
- ✗
Precompute SHAP values for all possible input combinations and store them in a Delta table for lookup during serving.
Why it's wrong here
Precomputing SHAP values for all possible input combinations is infeasible due to the combinatorial explosion of feature values, especially with continuous features. Even for a modest number of features, the number of combinations is astronomically large. This approach would also fail to handle new or unseen combinations, making it impractical for real-time serving and unable to provide explanations for all requests.
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.