0
0
Snowflakecloud~10 mins

ML model training in Snowflake - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a machine learning model in Snowflake.

Snowflake
CREATE MODEL my_model FROM my_table PREDICTING target USING [1]; 
Drag options to blanks, or click blank then click option'
ASELECT
BINSERT
CLINEAR_REGRESSION
DUPDATE
Attempts:
3 left
💡 Hint
Common Mistakes
Using SQL commands like SELECT or INSERT instead of a model type.
Omitting the model type after PREDICTING.
2fill in blank
medium

Complete the code to specify the input features for the model training.

Snowflake
CREATE MODEL my_model FROM my_table PREDICTING target USING LINEAR_REGRESSION INPUT ([1]);
Drag options to blanks, or click blank then click option'
AWHERE feature1 > 0
Btarget, feature1
CSELECT *
Dfeature1, feature2, feature3
Attempts:
3 left
💡 Hint
Common Mistakes
Including the target column as a feature.
Using SQL clauses like SELECT or WHERE inside INPUT.
3fill in blank
hard

Fix the error in the model training command by completing the missing clause.

Snowflake
CREATE MODEL my_model [1] my_table PREDICTING target USING LINEAR_REGRESSION INPUT (feature1, feature2);
Drag options to blanks, or click blank then click option'
AFROM
BWHERE
CSELECT
DJOIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using WHERE or JOIN instead of FROM after INPUT.
Omitting the FROM clause entirely.
4fill in blank
hard

Fill both blanks to evaluate the trained model using SQL.

Snowflake
SELECT predicted_label, actual_label FROM TABLE([1](MODEL => 'my_model', DATA => [2]));
Drag options to blanks, or click blank then click option'
AML.PREDICT
Bmy_table
Ctraining_data
DML.TRAIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using ML.TRAIN instead of ML.PREDICT for predictions.
Using a wrong table name or a keyword instead of a table.
5fill in blank
hard

Fill all three blanks to create a model, train it, and evaluate accuracy.

Snowflake
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]';
Drag options to blanks, or click blank then click option'
ALOGISTIC_REGRESSION
BML.EVALUATE
Caccuracy
DML.PREDICT
Attempts:
3 left
💡 Hint
Common Mistakes
Using ML.PREDICT instead of ML.EVALUATE to get accuracy.
Using regression model type for classification tasks.
Misspelling the metric name.