Databricks Machine Learning Associate · 31% practice allocation

Databricks Machine Learning Associate: Model Development Practice Questions

5 free sample questions from the Model Development domain, with answers and explanations. The full Machine Learning Associate bank has 461 questions across 4 domains. Questions are scenario-based and written from the official Databricks exam guide.

1.

A data scientist is using ParamGridBuilder with CrossValidator in PySpark ML and wants to select the final model configuration based on the highest average F1 score across folds, not accuracy. Which change is required to their MulticlassClassificationEvaluator setup?

  • A. No change is needed — CrossValidator always internally computes and optimizes for F1 for multiclass problems regardless of the evaluator's configured metric
  • B. Switch to BinaryClassificationEvaluator, which is required whenever F1 score is the target metric
  • C. Manually compute F1 for each fold outside of CrossValidator since it does not support any classification metric besides accuracy
  • D. Set the evaluator's metric parameter to f1 (e.g. metricName='f1') so CrossValidator selects the parameter combination that maximizes F1 across folds✓ Correct
Explanation

CrossValidator selects the best model according to whatever metric the supplied evaluator is configured for, so setting MulticlassClassificationEvaluator(metricName='f1') makes it optimize for F1 across folds. It does not silently default to F1 (option 2) or only accuracy (option 4) — the metric is whatever you configure. BinaryClassificationEvaluator (option 3) is for two-class problems evaluated by AUC/AUPRC and is not required for F1, which MulticlassClassificationEvaluator supports natively (including for two classes).

2.

A Databricks ML team is building a distributed training pipeline for a large NLP model using PyTorch on a multi-node Databricks cluster. They need a framework that natively integrates with Databricks Runtime for Machine Learning and handles distributed data-parallel training across multiple GPU nodes. Which TWO options are supported distributed training frameworks available on Databricks for this scenario? (Select TWO)

  • A. MLflow Projects with multi-node backend
  • B. Databricks AutoML with deep learning mode
  • C. TorchDistributor✓ Correct
  • D. Spark MLlib LogisticRegression with GPU acceleration
  • E. Horovod with HorovodRunner✓ Correct
Explanation

Horovod with HorovodRunner and TorchDistributor are both natively supported on Databricks Runtime for Machine Learning for distributed PyTorch training across multiple GPU nodes. HorovodRunner launches Horovod jobs using MPI across cluster workers. TorchDistributor is a newer Databricks-native API that launches PyTorch Distributed data-parallel jobs directly from a Spark driver. Databricks AutoML does not support custom large-scale NLP distributed training. Spark MLlib's LogisticRegression is a CPU-based algorithm that does not support GPU-accelerated deep learning. MLflow Projects is a packaging format, not a distributed training execution framework.

3.

A data scientist is building a Spark ML pipeline and needs to convert a categorical string column into a numeric representation before it can be used by a VectorAssembler. Which stage should immediately follow reading the raw categorical column, before one-hot encoding is applied?

  • A. VectorAssembler, which can accept raw string columns directly and infers indices automatically
  • B. StringIndexer, which maps each unique string category to a numeric index based on frequency✓ Correct
  • C. IDF, which converts categorical strings into inverse document frequency weighted vectors
  • D. StandardScaler, which is required before any categorical column can be processed further
Explanation

StringIndexer is the standard Spark ML stage for converting a categorical string column into numeric indices (ordered by descending frequency by default), which is a typical prerequisite before OneHotEncoder and eventually VectorAssembler. VectorAssembler (option 2) requires numeric or vector-type input columns; it cannot accept raw strings. StandardScaler (option 3) operates on numeric vector columns and is unrelated to encoding categoricals. IDF (option 4) is part of the TF-IDF text-processing workflow, not general categorical encoding.

4.

A data scientist wants to evaluate a multiclass classifier and report a single F1 score that gives every class equal weight regardless of how many examples each class has, so that a class with only a handful of examples influences the score as much as a dominant class. Which F1 averaging strategy achieves this?

  • A. Macro-averaged F1, which computes F1 per class and takes the unweighted mean across classes✓ Correct
  • B. Weighted-averaged F1, which weights each class's F1 by its number of examples, so dominant classes drive the score
  • C. Accuracy, since it is equivalent to F1 for multiclass problems with more than two classes
  • D. Micro-averaged F1, which aggregates true/false positives and negatives globally across all classes before computing a single F1
Explanation

Macro F1 computes F1 for each class independently and averages them without regard to class size, so rare classes count equally with common ones — exactly what is being asked for. Weighted F1 (option 2) does the opposite, letting large classes dominate. Micro F1 (option 3) aggregates counts globally, which in multiclass single-label settings tends to equal overall accuracy and is also dominated by frequent classes. Accuracy (option 4) is a distinct metric from F1 and is not equivalent to it, especially under class imbalance.

5.

A data scientist is building a gradient boosting model using PySpark's GBTClassifier. After training, they call model.transform(test_df) and examine the output schema. Which columns does the transform output include by default? (Select TWO)

  • A. score
  • B. confidence
  • C. probability
  • D. prediction✓ Correct
  • E. rawPrediction✓ Correct
Explanation

PySpark's GBTClassifier.transform() outputs 'rawPrediction' and 'prediction' columns by default. Unlike LogisticRegression or RandomForestClassifier, GBTClassifier does NOT output a 'probability' column because GBT models do not natively produce calibrated probability estimates in PySpark ML — this is a common misconception. 'prediction' contains the predicted class label. 'rawPrediction' contains the raw margin scores. 'score' and 'confidence' are not standard column names produced by any PySpark ML classifier.

Test yourself across every Machine Learning Associate domain

The free Machine Learning Associate practice test mixes about 20 questions weighted like the exam. The full 461-question bank adds instant grading, flashcards and a timed mock exam.

Study this domain

Model Development study guide (Machine Learning Associate) →

Other Machine Learning Associate domains

← All Databricks Machine Learning Associate study resources