Complete the code to create a machine learning model in Snowflake.
CREATE MODEL my_model FROM my_table PREDICTING target USING [1]; The CREATE MODEL statement requires specifying the model type, such as LINEAR_REGRESSION, to train a model in Snowflake.
Complete the code to specify the input features for the model training.
CREATE MODEL my_model FROM my_table PREDICTING target USING LINEAR_REGRESSION INPUT ([1]);The INPUT clause lists the columns used as input features for training the model. Only feature columns should be included, not the target.
Fix the error in the model training command by completing the missing clause.
CREATE MODEL my_model [1] my_table PREDICTING target USING LINEAR_REGRESSION INPUT (feature1, feature2);The FROM clause specifies the source table for training data in the model creation statement.
Fill both blanks to evaluate the trained model using SQL.
SELECT predicted_label, actual_label FROM TABLE([1](MODEL => 'my_model', DATA => [2]));
The ML.PREDICT function is used to get predictions from the model, and the data table (e.g., my_table) provides the input data for prediction.
Fill all three blanks to create a model, train it, and evaluate accuracy.
CREATE MODEL my_model FROM training_data PREDICTING target USING [1] INPUT (feature1, feature2); SELECT accuracy FROM TABLE([2](MODEL => 'my_model', DATA => test_data)) WHERE metric = '[3]';
First, specify the model type LOGISTIC_REGRESSION to create the model. Then use ML.EVALUATE to get evaluation metrics. Finally, filter by the metric name accuracy to see the model's accuracy.