Created
June 15, 2023 14:18
-
-
Save joshreini1/fcbe2db8911f67bc9973aba90af3e169 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query_attributions = """#standardsql | |
SELECT | |
(SELECT attribution FROM UNNEST(top_feature_attributions) WHERE feature = 'pageviews') AS pageviews, | |
(SELECT attribution FROM UNNEST(top_feature_attributions) WHERE feature = 'country') AS country, | |
(SELECT attribution FROM UNNEST(top_feature_attributions) WHERE feature = 'is_mobile') AS device_id, | |
(SELECT attribution FROM UNNEST(top_feature_attributions) WHERE feature = 'os') AS os | |
FROM 'gcp-sandbox-311420.bqml_tutorial.sample model preds explanations 0701 0708' | |
""" | |
job_attr = client.query(query_attributions) | |
df_attr = job_attr.to_dataframe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment