QuestionQ76

Prepare data and use feature engineering in Snowflake

A Data Scientist built and deployed a model that an external function calls. Feature engineering for the model was performed in a Machine Learning (ML) tool. When the external function calls the model using Snowflake data, it fails because the Snowflake-table columns do not match the columns expected by the endpoint.

Which step will enable the external function to work correctly?

  • A Perform the ML tool feature engineering within the external function.
  • B Clone the table and perform the ML tool feature engineering within the clone statement.
  • C Create a view that contains the transformed version of the original table and call the view in the external function.
  • D Create a User-Defined Function (UDF) that performs the feature engineering and call that within the external function.
Explanation

A view can define the feature transformations as a query over the original table and expose the exact feature columns expected by the deployed model endpoint. An external function is invoked in SQL with column arguments, so calling it with the transformed columns from that view sends an endpoint-compatible input schema without changing the source table. Snowflake external functions behave like UDFs in SQL and can be called with table columns.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!