Created
May 20, 2019 02:06
-
-
Save securetorobert/78418cd9a5cd76c78cf221b3451f220f to your computer and use it in GitHub Desktop.
Confusion Matrix in BQML
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
SELECT | |
* | |
FROM | |
ML.CONFUSION_MATRIX(MODEL `bqml_tutorial.sample_model`, | |
( | |
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 '20170801' AND '20170830'), | |
STRUCT(0.55 AS threshold)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment