Free cheat sheet

Databricks Machine Learning Associate

Two pages of the decision rules, defaults, APIs and traps the Databricks Machine Learning Associate exam tests, organised by the March 2025 exam guide's four domains.

Aligned to the March 2025 exam guide · checked against the Databricks docs on 31 October 2026 · certlake.com/exam/machine-learning-associate/cheat-sheet

Exam at a glance

The exam

48 scored questions · 90 min · pass mark not published · Python · March 2025 guide.

Weights

Domain%
Databricks Machine Learning38
Model Development31
Data Processing19
Model Deployment12

New names

Model Registry → Models in Unity Catalog · Workspace Feature Store → Feature Store in UC (FeatureEngineeringClient) · DLT → Lakeflow pipelines · Lakehouse Monitoring → data profiling · Hyperopt (unmaintained; the guide still says fmin) → Optuna or Ray Tune recommended.

1. Databricks Machine Learning38% of the exam

MLOps and Runtime ML

Promote code (retrain per environment) by default; promote models when training is very expensive or hard to reproduce (not viable if dev can't reach prod data). Code in Git, data and models in UC, a catalog per environment, jobs as a service principal.

Runtime ML = runtime + scikit-learn, XGBoost, PyTorch, MLflow, Feature Engineering, version-tested; GPU variants add CUDA.

AutoML

automl.classify / regress / forecast(dataset, target_col=…, timeout_minutes=…); Runtime ML up to 17.x (removed in 18.0), dedicated access mode for UC data. Gives a data exploration notebook and an editable notebook per trial, all logged to MLflow. Default split 60/20/20 random; time_col splits by time.

Feature tables (UC)

fe = FeatureEngineeringClient() → create_table(name, primary_keys, schema) · write_table(name, df, mode="merge") upserts (the only mode) · create_training_set(df, feature_lookups=[FeatureLookup(table_name, lookup_key, feature_names)], label) · log_model(…, training_set=…) stores the lookups, so score_batch(model_uri=…, df=keys_df) re-joins them — that's what avoids training/serving skew. Limits: 50 tables per model, 100 on-demand features.

Offline = Delta table, batch, training. Online = Online Feature Store (Lakebase), one row by key in ms, for endpoints. UC tables beat workspace ones: one definition, UC privileges, lineage.

MLflow tracking

Experiment → runs → params, metrics, tags, artifacts, model. Autologging is on for notebook training on Runtime ML; call mlflow.autolog() elsewhere (incl. serverless). The UI shows a run's params, metrics, artifacts, logged model and signature, source notebook and dataset.

Best run: mlflow.search_runs(order_by=["metrics.val_f1 DESC"], max_results=1) → pandas; MlflowClient().search_runs(…) → Run objects.

Models in Unity Catalog

mlflow.set_registry_uri("databricks-uc"), then register_model(f"runs:/{id}/model", "main.ml.churn") or registered_model_name=. Needs a signature. USE CATALOG + USE SCHEMA + CREATE MODEL to create a model (CREATE MODEL VERSION or ownership to add versions), EXECUTE to load or serve.

Promote by repointing an alias, not retraining: set_registered_model_alias(name, "champion", 4); also delete_registered_model_alias, set_registered_model_tag. Load models:/…@champion or /4.

2. Data Processing19% of the exam

Explore

describe() = count, mean, stddev, min, max · summary() adds 25/50/75% · dbutils.data.summarize(df) (Public Preview) and display()'s Data Profile tab profile every column · approxQuantile.

Two continuous → scatter, Pearson stat.corr. Two categorical → stat.crosstab, chi-square. Mixed → box plot per category.

Outliers

IQR: drop outside q1 - 1.5*iqr … q3 + 1.5*iqr; no distribution assumed, safer default. Z-score: ±3 stddev, assumes normal, distorted by the outliers themselves.

Imputation

Mean = symmetric continuous · median = skewed or outliers · mode = categorical. Imputer(strategy=…) ("mean", "median", "mode") is numeric only; strings use fillna. Fit on train only.

Encoding

StringIndexer orders by frequency (commonest = 0), handleInvalid="keep" for unseen labels. OneHotEncoder emits a sparse vector, dropLast=True. Needed by linear/logistic models and NNs; avoid for high-cardinality columns feeding trees, and for ordinals.

Transform and scale

Log (log1p if zeros) for right-skewed, non-negative features or targets; pointless for features fed to trees. StandardScaler (withMean=False by default), MinMaxScaler → [0,1], RobustScaler (median/IQR): for k-means, k-NN, SVM, regularised linear models, NNs; not trees.

3. Model Development31% of the exam

Algorithms and imbalance

Interpretability → linear/logistic or a shallow tree. Tabular accuracy → gradient-boosted trees. Segments → k-means (scale first). Rare events, no labels → isolation forest.

Imbalance: class weights (class_weight="balanced", scale_pos_weight, weightCol) · oversample/SMOTE (overfit risk) · undersample (loses data) · move the threshold · score with F1, recall or PR-AUC.

Estimator vs transformer

Estimator fit() → Transformer, because it learns statistics: StringIndexer, Imputer, StandardScaler, LogisticRegression. Transformer transform(): VectorAssembler, Tokenizer, fitted models. Pipeline is an estimator, PipelineModel a transformer.

Tuning

CrossValidator(numFolds=3) averages over folds: less variance, k× cost. TrainValidationSplit(trainRatio=0.75) is one hold-out: cheaper, noisier. Both refit the winner on the whole dataset as bestModel; parallelism defaults to 1.

Grid = every combination · random = usually better per unit cost · Bayesian/TPE (Optuna, Hyperopt fmin(…, algo=tpe.suggest, max_evals=…)) = usually fewer trials. Hyperopt's objective returns a loss to minimise (return -f1).

Metrics

Accuracy = balanced, equal error cost · precision = false positives cost · recall = false negatives cost · F1 = one number under imbalance · ROC-AUC = threshold-free ranking · PR-AUC = heavy imbalance · log loss = calibrated probabilities.

RMSE (target's units, punishes big misses) · MAE (robust to outliers) · R² (variance explained, can go negative). Evaluator defaults: rmse, areaUnderROC, f1.

Both errors high = underfit: add complexity or features. Train low, validation high = overfit: regularise, simplify, more data, early stopping.

4. Model Deployment12% of the exam

Pick the pattern

LatencyTriggerOutput
BatchMinutes–hoursScheduled jobA table
StreamingSecondsNew dataAppended table
Real timeMillisecondsApp requestHTTP response

Batch and streaming

One node: mlflow.pyfunc.load_model(uri), then .predict(pdf). Distributed: predict = mlflow.pyfunc.spark_udf(spark, uri), then df.withColumn("pred", predict(*cols)) — on read or readStream. Feature lookups: fe.score_batch(model_uri=uri, df=keys_df). SQL: ai_query('endpoint', request).

A Lakeflow pipeline is the streaming answer when the question also wants managed checkpoints, retries, expectations and autoscaling.

Endpoints

Custom model: subclass mlflow.pyfunc.PythonModel (load_context, predict), log_model(python_model=…, artifacts=…, input_example=…, pip_requirements=…), register in UC, create the endpoint. A dependency missing from the logged model is a common deployment error.

served_entities = {name, entity_name, entity_version, workload_size, scale_to_zero_enabled}; POST /serving-endpoints/<name>/invocations takes dataframe_split, dataframe_records or inputs. Scale to zero: no idle cost, cold start next request.

traffic_config.routes = served_model_name + traffic_percentage (e.g. 90/10): A/B tests and canaries behind one URL, rolled back by changing the percentages.

Monitoring

Inference tables log requests and responses to Delta. A monitor with the InferenceLog profile (problem type; timestamp, prediction and model-version columns) computes profile and drift metrics plus a dashboard, window over window, optionally against a baseline table, and per slice. Drift or falling quality is the retraining signal.

Know it, or just recognise it?

The free diagnostic shows which domains you'd lose marks on, in about 10 minutes and without signing up.

Take the free diagnostic

Study guide

The full study guide: every domain explained, with snippets and diagrams.

Open the study guide

Spotted something out of date? Email support@certlake.com. CertLake is not affiliated with Databricks, Inc.