Skip to main content
πŸ“˜ Complete PDF

Databricks Certification Practice Test 10

Practice Test 10

Question 1 of 30
πŸ“‹ Multiple Choice
Question 201
A retail company has trained a demand forecasting model. The model performs well in development, but business users and auditors cannot reproduce previous prediction results after an automated retraining cycle occurs. What is the BEST engineering practice to resolve this issue?
βœ“
A. Track and version all model artifacts, code, and training data in Unity Catalog and MLflow
B. Scale up cluster driver memory and worker core counts
C. Increase Delta Lake partition counts on source sales tables
D. Run OPTIMIZE and Z-ORDER on the model inference output directory
Answer
βœ… A. Track and version all model artifacts, code, and training data in Unity Catalog and MLflow
Explanation

1. Direct Question Answer & Core Concept βœ… A. Track and version all model artifacts, code, and training data in Unity Catalog and MLflow

Core Concept: Full ML reproducibility requires versioning the three core pillars of machine learning: code (Git commit), environment and model weights (MLflow Model Registry), and training dataset snapshots (Delta Lake Time Travel).

2. Deep-Dive Analytical Explanation Without explicit model and data versioning, retraining overwrites production artifacts, making historical auditability impossible. MLflow Model Registry in Unity Catalog assigns immutable semantic version numbers to registered models, while Delta Lake time travel records the exact table version used for training, ensuring complete historical reproducibility.

3. Comprehensive Option Analysis & Distractor Dissection - **A. Scale up cluster driver memory and worker core counts:** Compute scaling affects execution speed and capacity, not model versioning or audit reproducibility. - **C. Increase Delta Lake partition counts on source sales tables:** Adjusting partition layout alters file distribution; it provides zero model tracking or version control. - **D. Run OPTIMIZE and Z-ORDER on the model inference output directory:** Table file compaction accelerates query scanning but does not track model artifacts or historical weights.

4. Architectural & Execution Context / Physical Execution MLflow logs model artifacts, conda/pip dependencies, and input schemas to Unity Catalog Volumes. Registering a model in Unity Catalog (`catalog.schema.model_name`) creates a versioned, governed securable object with built-in lineage.

5. Practical Code Example

import mlflow
from mlflow.models import infer_signature

# Logging and registering a versioned model in Unity Catalog
mlflow.set_registry_uri("databricks-uc")

with mlflow.start_run() as run:
    # Log Delta Lake training data version for full reproducibility
    mlflow.log_param("delta_table_version", 42)
    mlflow.log_param("git_commit_sha", "c89f41b")
    
    # Train and log model with signature
    signature = infer_signature(X_train, y_train)
    mlflow.sklearn.log_model(
        sk_model=model,
        artifact_path="model",
        signature=signature,
        registered_model_name="prod_ml.forecasting.demand_model"
    )

6. Key Takeaway Ensure ML reproducibility by registering versioned models in Unity Catalog and logging the Delta table training commit.

7. Best Practice & Production Recommendation Always log the exact Delta table version (`spark.table('orders').history()`) as an MLflow run parameter so that training data can be reconstructed at any future date.

8. Real-World Engineering Scenario A demand model began predicting erratic inventory counts. Because the data science team used MLflow Model Registry in Unity Catalog, they instantly rolled back to Model Version 3 and inspected Version 4's training data via Delta Time Travel to find the corrupt ingestion batch.

9. Common Exam Trap / Anti-Pattern / Misconception Relying on file-path naming conventions (e.g., `model_v2_final_final.pkl`) instead of an official Model Registry. Manual file naming lacks lineage, signature enforcement, and access controls.

10. Related InsightfulSaga Tutorial Master these concepts in [Databricks Machine Learning & MLOps](/tutorials/databricks/databricks-model-registry).

Answered: 0 / 30
Question Navigator (Test 10)0% Answered