Courseiva
Databricks Machine Learning →mediumMultiple Choice

Databricks-ML-Assoc Databricks Machine Learning Practice Question

A data scientist has trained a scikit-learn model and wants to log it to MLflow with a custom signature that includes input and output schema. Which MLflow method should they use to log the model along with the signature?

⚠ Common exam trap

The trap here is using the generic log_model or log_artifact instead of the flavor-specific function that supports signatures.

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.sklearn.log_model(model, "model", signature=signature)

The data scientist needs to log a scikit-learn model with a signature. MLflow provides flavor-specific functions like mlflow.sklearn.log_model that accept a signature parameter. This logs the model with the schema, enabling proper validation and serving. The generic mlflow.log_model is not directly used for scikit-learn, mlflow.log_artifact lacks model metadata, and mlflow.register_model is for registration, not logging. Therefore, mlflow.sklearn.log_model is correct.

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.register_model(model, "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; it requires a model URI. Using it directly on a model object is incorrect. The model must first be logged using a flavor-specific log_model function, and then registered. Thus, it is not the method for logging a model with signature.

  • ✓

    mlflow.sklearn.log_model(model, "model", signature=signature)

    Why this is correct

    mlflow.sklearn.log_model is the correct method to log a scikit-learn model. It accepts a signature parameter, which can be created using mlflow.models.infer_signature or manually. This logs the model along with the schema, enabling validation and serving. It is the standard way to persist scikit-learn models in MLflow with additional metadata such as input/output types.

  • ✗

    mlflow.log_artifact(model, "model")

    Why it's wrong here

    mlflow.log_artifact logs a file or directory as an artifact, but it does not provide model-specific logging such as signature or flavor. It would simply store the model file without the necessary metadata for serving or validation. This approach lacks the integration with MLflow's model registry and deployment tools, making it unsuitable for logging a model with signature.

  • ✗

    mlflow.log_model(model, "model", signature=signature)

    Why it's wrong here

    mlflow.log_model is a generic function that requires a model flavor to be specified, typically via the artifact_path and a model object that implements the MLflow model interface. It is not the direct method for scikit-learn models; using it without the proper flavor may fail or not log the model correctly. The scikit-learn specific function is preferred for scikit-learn models.

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.