Databricks Machine Learning Associate Question 436
Select 3You are working on a machine learning project and have engineered a new set of features for your model. You want to store these features in a Databricks Feature Store table for reuse across multiple models. Which of the following steps are required to write the data to the feature store table?
- A
Define a feature store client using the
FeatureStoreClientclass. - B
Ensure that the data being written is in the form of a Spark DataFrame.
- C
Use the
create_tablemethod from the feature store client to save the features. - D
Specify a unique primary key for the feature store table.
- E
Directly write the feature data to the feature store table using
spark.write.table().
Show answer and explanation
Correct answers: A, B, D
Explanation
To write data to a feature store table in Databricks, you need to first initialize a FeatureStoreClient, ensure the data is in the form of a Spark DataFrame, and specify a unique primary key for the table. The FeatureStoreClient provides the appropriate methods for writing data, rather than directly using spark.write.table(). Properly understanding these requirements ensures efficient feature management and reuse.
- A. Correct.
Correct. To interact with the Databricks Feature Store, you must create an instance of the
FeatureStoreClientclass. - B. Correct.
Correct. The Databricks Feature Store expects the data being written to be in the form of a Spark DataFrame.
- C. Incorrect.
Incorrect. The
create_tablemethod is used to define a new feature store table, but it is not used directly to write feature data. Writing data typically requires thewrite_tablemethod. - D. Correct.
Correct. A unique primary key is required to identify individual feature records in the feature store table.
- E. Incorrect.
Incorrect. You cannot directly use
spark.write.table()to write to a feature store table. The Feature Store has its own API for managing and writing data.