Courseiva
Model Development →mediumMultiple Select

Databricks-ML-Assoc Model Development Practice Question

A data scientist is using MLflow tracking on Databricks to log a model training run. They want to capture the model's hyperparameters, evaluation metrics, and the trained model artifact so that the run can be reproduced and the model can be deployed later. Which two MLflow API calls should they use to log the model artifact and its input/output schema? (Choose two.)

⚠ Common exam trap

The trap here is thinking that logging a model file as a generic artifact is sufficient, when MLflow requires a model-specific logging API and a signature for schema enforcement.

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(sk_model, "model", signature=signature)

To log a model artifact with its schema, the scientist should use a model-specific logging method like mlflow.sklearn.log_model with a signature argument, and generate that signature using mlflow.models.signature.infer_signature. Together, these capture the model, its flavor, dependencies, and input/output schema, enabling deployment and validation. Generic artifact, metric, or param logging calls do not provide the model and schema metadata.

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.log_artifact("model.pkl")

    Why it's wrong here

    log_artifact uploads a file to the run's artifact store but does not capture model signature or flavor information. It is a generic artifact logging method, not model-specific. While it can store a serialized model file, it lacks the metadata needed for deployment tools to understand the model's input and output schema. For proper model logging, the dedicated model logging APIs should be used instead.

  • ✗

    mlflow.log_param("max_depth", 10)

    Why it's wrong here

    log_param logs a single hyperparameter for the run. It does not persist the model or its signature. Parameters are useful for reproducibility but are separate from model artifacts. Using only log_param would leave the model unlogged and undeployable. The question specifically asks for logging the model artifact and its schema, which requires a model logging method.

  • ✓

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

    Why this is correct

    This call logs a scikit-learn model with a specified signature, which defines the input and output schema. It also captures the model's flavor and dependencies, enabling later loading and deployment. Including the signature allows tools like MLflow Model Serving to validate input data and provide schema hints. This is the correct way to log a model artifact along with its schema in MLflow.

  • ✓

    mlflow.models.signature.infer_signature(X_train, y_train)

    Why this is correct

    infer_signature generates a ModelSignature object from sample input and output data. This signature can then be passed to a model logging call such as log_model to capture the schema. It is a helper function that creates the signature, not a logging call itself, but it is essential for defining the schema. Using it together with a model logging API satisfies the requirement of logging the model with its input/output schema.

  • ✗

    mlflow.log_metric("accuracy", 0.95)

    Why it's wrong here

    log_metric records a single evaluation metric for the run. It does not log the model artifact or its schema. While metrics are important for tracking performance, they do not fulfill the requirement of capturing the model and its input/output signature. The scientist needs a model logging API, not a metric logging API.

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.