Databricks Machine Learning Associate Question 439
Single answerYou are tasked with training a machine learning model in Databricks to predict customer churn. The feature engineering team has already created a feature store table called customer_churn_features. How should you correctly retrieve features from this feature store table and use them to train a machine learning model?
- A
Use the Databricks Feature Store Python API to load features into a DataFrame and directly pass them to the model training function.
- B
Load the
customer_churn_featurestable as a Delta table using Spark SQL and train your model using the loaded DataFrame. - C
Use the Databricks Feature Store Python API to load features into a training set and include labels by specifying a lookup DataFrame.
- D
Manually extract features from the
customer_churn_featurestable using SQL and join them with the labels before training the model.
Show answer and explanation
Correct answer: C
Explanation
The Databricks Feature Store is designed to facilitate feature management, including retrieving, versioning, and tracking features. The recommended approach for training a model with features from a feature store table is to use the Feature Store Python API to create a training set, which ensures that features are correctly retrieved and associated with labels. This approach also leverages the built-in tracking and metadata management capabilities of the Feature Store.
- A. Incorrect.
This is incorrect because while you can load features into a DataFrame, the recommended approach involves using a training set created with the Feature Store API, which also handles label association.
- B. Incorrect.
This is incorrect because loading the feature table as a Delta table bypasses the Feature Store API, which is specifically designed to manage feature metadata and ensure consistency.
- C. Correct.
This is correct because the Databricks Feature Store Python API allows you to create a training set by combining the features with the labels, ensuring proper feature association and metadata tracking.
- D. Incorrect.
This is incorrect because manually extracting features and joining them with labels does not leverage the capabilities of the Databricks Feature Store, such as automated tracking and lineage.