Created
March 1, 2019 10:48
-
-
Save vaibhawvipul/6ec7cad2a137c69a03e5ad6062ffcaab to your computer and use it in GitHub Desktop.
BigQuery 101: All the Basics You Need to Know - Code for Velotio Blog Part - 2
This file contains hidden or 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
| CREATE MODEL `velotio_tutorial.sample_model` | |
| OPTIONS(model_type='logistic_reg') AS | |
| SELECT | |
| IF(totals.transactions IS NULL, 0, 1) AS label, | |
| IFNULL(device.operatingSystem, "") AS os, | |
| device.isMobile AS is_mobile, | |
| IFNULL(geoNetwork.country, "") AS country, | |
| IFNULL(totals.pageviews, 0) AS pageviews | |
| FROM | |
| `bigquery-public-data.google_analytics_sample.ga_sessions_*` | |
| WHERE | |
| _TABLE_SUFFIX BETWEEN '20190401' AND '20180630' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment