Exam Certified Machine Learning Professional All QuestionsBrowse all questions from this 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?

    Correct Answer: D

    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
hugodscarvalhoOption: D

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

mozucaOption: D

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

BokNinjaOption: D

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.