A model was logged with fe.log_model. The scoring table has only customer_id. Which call scores it with automatic feature lookup?
- Exam domain
- Databricks Machine Learning36% of the exam
- Difficulty
- Medium
- In this mock
- 18 questions on this domainPractise this domain
Why the exam asks this
Databricks Machine Learning (36% of the exam)
Objective in the exam guide: Score a model using features from a feature store table
Scoring with feature store features is named.
Why C is the answer
fe.score_batch(model_uri="models:/main.ml.churn@champion", df=ids)
score_batch reads the feature lookup metadata stored with the model, joins the features by key and returns predictions.
Remember: score_batch does the lookup.
How it works
score_batch uses model metadata to fetch features.
In detail
- score_batch looks up features.
- Input needs only the keys.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. mlflow.log_metric("score", df)Wrong
log_metric logs a value.
B. joblib.load("/dbfs/models/churn.pkl").predict(ids.toPandas()) on the driver nodeWrongMost tempting
Plain predict needs the features already joined.
Why it tempts: predict is the usual call, but it skips the lookup.
C. fe.score_batch(model_uri="models:/main.ml.churn@champion", df=ids)Right
score_batch does the lookup.
D. spark.sql("PREDICT churn")Wrong
There is no PREDICT SQL here.
Use case
An illustrative scenario, not a real incident.
Illustrative: a weekly job passes 2 million customer ids to score_batch.
See it in different ways
sequenceDiagram participant P0 as ids DataFrame participant P1 as score_batch participant P2 as Feature table P0->>P1: customer_id only P1->>P2: look up features P1-->>P0: predictions
How to read this chart
- 1. ids DataFrame sends "customer_id only" to score_batch.
- 2. score_batch sends "look up features" to Feature table.
- 3. ids DataFrame gets a reply from score_batch: "predictions".
flowchart LR S0["Load ids"] --> S1["score_batch"] --> S2["Write predictions"]
How to read this chart
- Read it in order: Load ids, then score_batch, then Write predictions.