
Answer-first summary for fast verification
Answer: When all of the features utilized by the model at `model_uri` are present in a Spark DataFrame in the PySpark session.
The `fs.score_batch()` method in Databricks is designed for scoring a DataFrame in batch mode using a specified model. It requires that the DataFrame provided contains all the necessary features the model needs to make predictions. In this scenario, `batch_df` only contains the `order_id` feature. Therefore, the code will only successfully perform the prediction if all features required by the model at `model_uri` are available within a Spark DataFrame in the PySpark session. - **Option A** is incorrect because the code can work under specific conditions. - **Option B** is incorrect as it assumes the model only needs `order_id`, which may not be the case. - **Option C** is incorrect because batch scoring implies the model uses features from the Feature Store, which are automatically registered. - **Option D** is incorrect because while having all features in one Feature Store table could work, it's not a necessity as features can come from various sources.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
A machine learning engineer is planning to perform batch model predictions using a decision tree model located at model_uri on a DataFrame batch_df with the schema: order_id STRING. The engineer executes the following code block: predictions = fs.score_batch(model_uri, batch_df). Under what conditions will this code block successfully perform the desired prediction? Choose the ONE best answer.
A
This code block will not achieve the desired prediction in any situation.
B
When the model at model_uri uses only order_id as a feature.
C
When the Feature Store feature set was registered along with the model at model_uri.
D
When all of the features utilized by the model at model_uri are housed within one Feature Store table.
E
When all of the features utilized by the model at model_uri are present in a Spark DataFrame in the PySpark session.
No comments yet.