Databricks Machine Learning Associate Question 440
Select 3You are tasked with training a machine learning model using features stored in a Databricks Feature Store table. Which of the following steps are required to successfully retrieve features from the feature store and train the model?
- A
Create a FeatureStoreClient to interact with the feature store.
- B
Use the FeatureStoreClient's
read_tablemethod to load the features into a Spark DataFrame. - C
Convert the retrieved Spark DataFrame into a pandas DataFrame before training the model.
- D
Split the retrieved features DataFrame into training and testing datasets before model training.
- E
Write the trained model back to the feature store using the
log_modelmethod.
Show answer and explanation
Correct answers: A, B, D
Explanation
To train a model using features from a Databricks Feature Store table, you need to first create a FeatureStoreClient to interact with the feature store, then use the read_table method to retrieve features into a Spark DataFrame. The retrieved DataFrame should be split into training and testing datasets before training. Converting the DataFrame to pandas or logging the model back to the feature store are not mandatory steps for this process.
- A. Correct.
Correct: Creating a FeatureStoreClient is a necessary step to interact with the Databricks Feature Store and retrieve feature data.
- B. Correct.
Correct: The
read_tablemethod is used to load feature data from a feature store table into a Spark DataFrame. - C. Incorrect.
Incorrect: Converting the Spark DataFrame into a pandas DataFrame is not a requirement for model training. Spark MLlib models can train directly on Spark DataFrames.
- D. Correct.
Correct: Splitting the retrieved DataFrame into training and testing datasets is a standard step in preparing data for machine learning model training.
- E. Incorrect.
Incorrect: While
log_modelcan be used to save a model to the feature store, it is not a required step for retrieving features or training the model. Logging the model is a separate task performed after training.