Certified Machine Learning Professional Exam QuestionsBrowse all questions from this exam

Certified Machine Learning Professional Exam - Question 15


A data scientist has computed updated feature values for all primary key values stored in the Feature Store table features. In addition, feature values for some new primary key values have also been computed. The updated feature values are stored in the DataFrame features_df. They want to replace all data in features with the newly computed data.

Which of the following code blocks can they use to perform this task using the Feature Store Client fs?

Show Answer
Correct Answer: DE

To replace all data in a Feature Store table with newly computed data, you need to use the Feature Store Client's write_table method with the mode set to 'overwrite'. This ensures that the existing data in the feature table is completely replaced with the new data from the DataFrame features_df. The correct code block would use the write_table method with the 'overwrite' mode, which is shown in the option where fs.write_table(name='features', df=features_df, mode='overwrite') is used.

Discussion

3 comments
Sign in to comment
hugodscarvalhoOption: D
Jan 27, 2024

The data scientist already has the table created, so the method should be "write_table". Since he wants to replace all data in features with the newly computed data the "mode" overwrite should be used. Doc: https://docs.databricks.com/en/machine-learning/feature-store/workspace-feature-store/feature-tables.html#create-a-feature-table-in-databricks-feature-store

BokNinjaOption: D
Dec 19, 2023

Answer is D. The mode='overwrite' argument ensures that the existing data in the feature table is replaced with the new data from features_df1.

mozucaOption: D
Dec 27, 2023

Alternatively, you can create_table with schema only (without df), and populate data to the feature table with fs.write_table, fs.write_table has both overwrite and merge mode. Example: fs.create_table( name=table_name, primary_keys=["index"], schema=airbnb_df.schema, description="Original Airbnb data" ) fs.write_table( name=table_name, df=airbnb_df, mode="overwrite" ) Is this case the answer is D