Skip to content

Commit

Permalink
Change parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
agregori97 committed Jul 25, 2024
1 parent 8a79ea1 commit d7f3c0a
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions views/bqml/purchase_propensity/future_input.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,6 @@ view: future_input {
SELECT
* EXCEPT(will_purchase_in_future)
FROM user_model
WHERE @{BQML_PARAMETER}='Yes';;
WHERE "@{BQML_PARAMETER}"='Yes';;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include: "/views/*.view.lkml"
explore: pred_history {}
view: pred_history {
derived_table: {
sql_trigger_value:CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END;;
sql_trigger_value:CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END;;
explore_source: sessions {
column: pred_probability_bucket { field: future_purchase_prediction.pred_probability_bucket }
column: total_purchase_revenue_usd { field: events.total_purchase_revenue_usd }
Expand Down Expand Up @@ -57,7 +57,7 @@ explore: incremental_prediction {hidden:yes}
view: incremental_prediction {
derived_table: {
#datagroup_trigger: bqml_datagroup
sql_trigger_value:CASE WHEN @{BQML_PARAMETER}='Yes' AND ${pred_history.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END;;
sql_trigger_value:CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${pred_history.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END;;
create_process: {
sql_step:
CREATE TABLE IF NOT EXISTS ${SQL_TABLE_NAME} (
Expand Down Expand Up @@ -96,4 +96,4 @@ view: incremental_prediction {
description: "Pred History Propensity to Purchase Person Count"
type: sum
}
}
}
16 changes: 8 additions & 8 deletions views/bqml/purchase_propensity/predictions.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include: "/views/sessions/*.view"

view: future_purchase_model {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_input.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_input.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_create:
CREATE OR REPLACE MODEL ${SQL_TABLE_NAME}
OPTIONS(
Expand Down Expand Up @@ -41,7 +41,7 @@ explore: feature_importance {hidden:yes}
# VIEWS:
view: future_purchase_model_evaluation {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql:
SELECT * FROM ml.EVALUATE(
MODEL ${future_purchase_model.SQL_TABLE_NAME},
Expand All @@ -57,7 +57,7 @@ view: future_purchase_model_evaluation {

view: roc_curve {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql:
SELECT * FROM ml.ROC_CURVE(
MODEL ${future_purchase_model.SQL_TABLE_NAME},
Expand Down Expand Up @@ -104,7 +104,7 @@ view: roc_curve {

view: confusion_matrix {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql:
SELECT Expected_label,_0 as Predicted_0,_1 as Predicted_1 FROM ml.confusion_matrix(
MODEL ${future_purchase_model.SQL_TABLE_NAME},
Expand All @@ -117,7 +117,7 @@ view: confusion_matrix {

view: future_purchase_model_training_info {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql:
SELECT * FROM ml.TRAINING_INFO(MODEL ${future_purchase_model.SQL_TABLE_NAME});;
}
Expand Down Expand Up @@ -151,7 +151,7 @@ view: future_purchase_model_training_info {

view: feature_importance {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql:
SELECT
*
Expand All @@ -166,7 +166,7 @@ view: feature_importance {
explore: future_purchase_prediction {hidden:yes}
view: future_purchase_prediction {
derived_table: {
sql_trigger_value: CASE WHEN @{BQML_PARAMETER}='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql_trigger_value: CASE WHEN "@{BQML_PARAMETER}"='Yes' AND ${future_purchase_model.SQL_TABLE_NAME} THEN TRUE ELSE FALSE END ;;
sql:
select
pred.*,
Expand Down Expand Up @@ -251,4 +251,4 @@ view: future_purchase_prediction {
label:"Person Count"
type: count
}
}
}
4 changes: 2 additions & 2 deletions views/bqml/purchase_propensity/testing_input.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,6 @@ view: testing_input {
SELECT
*
FROM user_model
WHERE @{BQML_PARAMETER}='Yes';;
WHERE "@{BQML_PARAMETER}"='Yes';;
}
}
}
4 changes: 2 additions & 2 deletions views/bqml/purchase_propensity/training_input.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,6 @@ view: training_input {
SELECT
*
FROM user_model
WHERE @{BQML_PARAMETER}='Yes' ;;
WHERE "@{BQML_PARAMETER}"='Yes' ;;
}
}
}
2 changes: 1 addition & 1 deletion views/sessions/session_list_with_event_history.view.lkml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ view: session_list_with_event_history {
default_value: "@{BQML_PARAMETER}"

}
}
}

0 comments on commit d7f3c0a

Please sign in to comment.