Databricks-ML-Assoc Model Development Practice Question
A data scientist is tuning a scikit-learn GradientBoostingClassifier on Databricks. They use Hyperopt with the fmin function and the SparkTrials backend, but they notice that the best model returned by fmin is not identical to the model they get when they retrain with the same hyperparameters. They also observe that the logged metrics from each trial vary slightly even when the same hyperparameters are used. What is the most likely cause?
⚠ Common exam trap
The trap here is assuming that distributed training with SparkTrials introduces data inconsistency, when the real issue is the lack of a fixed random seed in the estimator.
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
✓
The random seed for the classifier is not fixed, so each trial and the final retrain produce different random splits and initialization, leading to slight variations.
The mismatch and metric variation occur because the model training is non-deterministic. GradientBoostingClassifier uses random processes for feature subsampling and sample selection when subsample is less than 1.0. Without setting a fixed random_state, each run produces a slightly different model, even with identical hyperparameters. This explains both the differing trial metrics and the final model discrepancy.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The random seed for the classifier is not fixed, so each trial and the final retrain produce different random splits and initialization, leading to slight variations.
Why this is correct
GradientBoostingClassifier uses randomness in feature subsampling and in the order of samples if subsample < 1.0. Without a fixed random_state, each trial and the final retrain will have different random seeds, causing slight differences in the fitted model and metrics. This is the most likely cause of the observed variation and mismatch.
- ✗
SparkTrials runs each trial on a different worker node, and the data is shuffled differently on each node, causing divergent results.
Why it's wrong here
SparkTrials distributes trials across Spark workers, but it does not shuffle the training data differently per node. The data partitioning is consistent and determined by the Spark DataFrame. The variation in metrics and the mismatch in the final model are not caused by data shuffling on different nodes; they stem from randomness in the model's internal processes when the random seed is not fixed.
- ✗
Hyperopt's fmin function does not support scikit-learn models; it only works with MLflow models, so the returned model is a placeholder.
Why it's wrong here
Hyperopt's fmin works with any Python function, including scikit-learn model training. It does not require MLflow models. The returned object is the actual best model or a copy, not a placeholder. The issue described is not due to incompatibility but to non-deterministic training.
- ✗
SparkTrials caches the training data on each worker, and the cache is not invalidated between trials, causing stale data to be used.
Why it's wrong here
SparkTrials does not cache training data in a way that causes staleness. Each trial uses the same data, and caching would not introduce variation in model results. The observed differences are due to random seed variations, not data caching issues.
About these practice questions
Courseiva writes every Databricks-ML-Assoc question from scratch — 319 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 →
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.