Courseiva
Model Development →hardMultiple Choice

Databricks-ML-Pro Model Development Practice Question

A data scientist is using MLflow to log a model that includes a custom preprocessing step implemented in Python. They want to ensure that the preprocessing logic is packaged with the model so that it can be served consistently. Which MLflow model flavor should they use?

⚠ Common exam trap

The trap here is assuming that a library-specific flavor like `mlflow.sklearn` will automatically package custom Python preprocessing, when it may only save the model object and require external code.

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.pyfunc`

The `mlflow.pyfunc` flavor is designed for custom Python models and allows embedding arbitrary preprocessing and postprocessing logic. By creating a `PythonModel` subclass, the data scientist can package the entire inference pipeline, ensuring consistency between training and serving. Other flavors are library-specific and may not capture custom Python steps outside their frameworks. Thus, `mlflow.pyfunc` is the correct choice.

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.tensorflow`

    Why it's wrong here

    The `mlflow.tensorflow` flavor is for TensorFlow models. It does not support packaging custom Python preprocessing logic that is not part of the TensorFlow graph. Using this flavor would not ensure the preprocessing is bundled with the model. Therefore, it is not the correct choice for this scenario.

  • ✗

    `mlflow.pytorch`

    Why it's wrong here

    The `mlflow.pytorch` flavor is specific to PyTorch models. It does not accommodate arbitrary Python preprocessing steps unless they are part of the PyTorch model's forward pass. If the preprocessing is separate from the neural network, this flavor would not package it. Thus, it is not suitable for a custom Python preprocessing step.

  • ✓

    `mlflow.pyfunc`

    Why this is correct

    The `mlflow.pyfunc` flavor allows packaging any Python model with custom preprocessing and prediction logic. By subclassing `PythonModel` and implementing `predict`, the data scientist can include preprocessing steps directly in the model artifact. This ensures the entire logic is self-contained and reproducible during serving. It is the most flexible flavor for custom code.

  • ✗

    `mlflow.sklearn`

    Why it's wrong here

    The `mlflow.sklearn` flavor is designed for scikit-learn models and pipelines. While scikit-learn pipelines can include custom transformers, they must be defined in a module that is available at load time. If the custom preprocessing is not part of a scikit-learn pipeline or relies on external code, this flavor may not package it correctly. It is not the most flexible choice for arbitrary Python preprocessing.

About these practice questions

Courseiva writes every Databricks-ML-Pro question from scratch — 300 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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-Pro 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-Pro exam.