Databricks Certified Machine Learning Associate · Free Practice Question Medium

Question 14

A machine learning model has been trained and evaluated successfully using Databricks MLlib. The data scientist now needs to deploy the model for real-time predictions in a production environment.

What steps should they take?

  • A

    Export the model as a serialized file and deploy it on a separate server.

  • B

    Use MLflow to package the model and deploy it as a REST API endpoint.

  • C

    Save the model to a Delta table and query it for predictions.

  • D

    Schedule a Databricks Job to run the model periodically.

Reveal correct answer

Correct answer: B

Explanation

Correct Answer:
Use MLflow to package the model and deploy it as a REST API endpoint.

Explanation:

The most robust and scalable approach for deploying a Databricks MLlib model in production is to use MLflow to:

  1. Package the Model:

    • Log the trained model using mlflow.spark.log_model().

    • MLflow automatically captures dependencies (e.g., PySpark, Python version).

  2. Deploy as a REST API:

    • Use MLflow Model Serving or deploy to Azure ML/AWS SageMaker for real-time inference.

    • Example:

    • This provides a scalable, low-latency endpoint for predictions.

Why Other Options Are Incorrect:

  1. Export as a serialized file and deploy on a separate server:

    • Manual deployment is error-prone (dependency mismatches, scaling issues).

    • Lacks the monitoring and scalability of MLflow.

  2. Save to a Delta table and query for predictions:

    • Delta tables are for data storage, not model serving.

    • Real-time predictions require low-latency APIs, not batch queries.

  3. Schedule a Databricks Job for periodic runs:

    • Jobs are for batch processing, not real-time inference.

Key Benefits of MLflow Deployment:

✅ Dependency Management: Auto-captures Python/Spark versions.
✅ Scalability: Built-in load balancing (e.g., via Databricks Model Serving).
✅ Monitoring: Track latency, errors, and usage metrics.

Example Workflow:

  1. Train → Log model with MLflow.

  2. Deploy → Enable "Model Serving" in Databricks UI or export to cloud platforms.

  3. Call API:

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need