Courseiva
Databricks Machine Learning →mediumMultiple Choice

Databricks-ML-Assoc Databricks Machine Learning Practice Question

A data scientist is using MLflow to log a custom PyTorch model in a Databricks notebook. They want to register the model in the Databricks Model Registry and later serve it with MLflow model serving. Which function should they call within their MLflow run to log the model with the necessary signature and dependencies?

⚠ Common exam trap

Candidates often confuse model logging with model registration or using a non-existent generic logging function.

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

✓

mlflow.pytorch.log_model()

To log a PyTorch model, the correct function is mlflow.pytorch.log_model. It handles saving the model in MLflow's format, capturing dependencies and signatures, and making it available for registration and serving. Other functions either don't exist, serve different purposes, or are not flavor-specific.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    mlflow.pytorch.log_model()

    Why this is correct

    mlflow.pytorch.log_model() is the correct function to log a PyTorch model. It saves the model in MLflow format, captures dependencies, and allows specifying a signature and input example. This enables the model to be registered in the Model Registry and served with MLflow model serving. The function is part of the MLflow PyTorch flavor and is designed for this purpose.

  • ✗

    mlflow.save_model()

    Why it's wrong here

    mlflow.save_model() is not a standard MLflow function for logging models to a run. MLflow has mlflow.save_model for saving a model to a local path, but it is not the primary method to log models for tracking and registry. For logging to a run, flavor-specific log_model functions should be used. This option is a distractor because it sounds like a persistence function but lacks integration with the tracking server.

  • ✗

    mlflow.log_model()

    Why it's wrong here

    mlflow.log_model() does not exist in the MLflow API. MLflow provides flavor-specific log_model functions such as mlflow.pytorch.log_model, mlflow.sklearn.log_model, etc. Using a generic log_model would not capture framework-specific metadata, signatures, or dependencies required for serving. This option is plausible because it sounds like a generic logging function, but it is not valid in MLflow.

  • ✗

    mlflow.register_model()

    Why it's wrong here

    mlflow.register_model() registers an already logged model to the Model Registry. It does not log the model itself. The scenario requires logging the model first. While registration is a subsequent step, calling register_model without first logging would fail because there is no model artifact to register. This option confuses registration with logging.

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 →

How Courseiva writes practice questions · Editorial policy

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.