Databricks Machine Learning Associate · Section 3 · 31% of the exam
Choose the most appropriate metric for a given scenario objective
One of the objectives of the Databricks Certified Machine Learning Associate exam, in the section “Model Development”. Here is what it covers, the points to remember and a question to try.
What it covers
Classification metrics come from the confusion matrix (precision, recall, F1, accuracy) or from predicted scores (ROC AUC, PR AUC, log loss); regression metrics measure error size (RMSE, MAE) or explained variance (R-squared). Choose the metric that matches the business cost of each error. When a model predicts a log-transformed target, exponentiate the predictions before computing metrics or interpreting them.
Points to remember
- Precision = TP / (TP + FP), recall = TP / (TP + FN), F1 = their harmonic mean; accuracy misleads on imbalanced data.
- ROC AUC (0.5 = random) measures ranking across thresholds; PR AUC suits rare positives; log loss needs probabilities and rewards calibration (lower is better).
- Spark evaluators: Binary (areaUnderROC default, areaUnderPR), Multiclass (f1 weighted default, accuracy, fMeasureByLabel, recallByLabel, logLoss), Regression (rmse default, mse, r2, mae, var).
- RMSE penalizes large errors and is outlier-sensitive; MAE is robust; R-squared is unitless, 1 is perfect, 0 equals predicting the mean, and it can be negative.
- Choose by error cost: recall when misses are costly, precision when false alarms are costly, log loss when probabilities feed decisions, MAE when outliers shouldn't dominate.
In the course
The lesson Evaluation Metrics and Log-Transformed Targets teaches this objective (about 45 minutes), and 18 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.
More in this section
- Use ML foundations to select the appropriate algorithm for a given model scenario
- Identify methods to mitigate data imbalance in training data
- Compare estimators and transformers
- Develop a training pipeline
- Use Hyperopt's fmin operation to tune a model's hyperparameters
- Perform random or grid search or Bayesian search as a method for tuning hyperparameters.
- Parallelize single node models for hyperparameter tuning
- Describe the benefits and downsides of using cross-validation over a train-validation split.
- Perform cross-validation as a part of model fitting.
- Identify the number of models being trained in conjunction with a grid-search and cross-validation process.
- Use common classification metrics: F1, Log Loss, ROC/AUC, etc
- Use common regression metrics: RMSE, MAE, R-squared, etc.