Databricks Machine Learning Associate Question 89
Single answerYou are tasked with training a machine learning model in Databricks using features stored in a feature store. After registering the feature table and performing exploratory data analysis, what is the correct sequence of steps to train the model using the feature store?
- A
Load the feature table into a DataFrame, join it with the target labels, and use the resulting DataFrame to train the model.
- B
Directly pass the feature table name to the MLlib API to train the model.
- C
Use the feature store API to retrieve the feature DataFrame, join it with the target labels, and then train the model on the joined data.
- D
Export the feature table data to a CSV file, merge it with the target labels outside Databricks, and re-import the data to train the model.
Show answer and explanation
Correct answer: C
Explanation
When using the Databricks Feature Store, the recommended approach is to use the feature store API to retrieve features as a DataFrame, join them with the target labels, and train the model using the resulting DataFrame. This approach ensures consistency and proper tracking of features, enabling reproducibility and feature lineage.
- A. Incorrect.
This option is incorrect because it does not involve using the feature store API, which is the recommended way to retrieve features for training models in Databricks.
- B. Incorrect.
This option is incorrect because the MLlib API does not accept feature table names directly; you need to retrieve the data as a DataFrame first.
- C. Correct.
This option is correct because it follows the best practice of using the Databricks Feature Store API to retrieve features, join them with the target labels, and train the model on the resulting DataFrame.
- D. Incorrect.
This option is incorrect because exporting and re-importing data adds unnecessary complexity and does not leverage the feature store capabilities within Databricks.