Skip to content

Instantly share code, notes, and snippets.

@svenmueller
Created August 1, 2018 14:14
Show Gist options
  • Save svenmueller/8d85f7930c38086b459e9742dcaac55f to your computer and use it in GitHub Desktop.
Save svenmueller/8d85f7930c38086b459e9742dcaac55f to your computer and use it in GitHub Desktop.
#standardSQL
CREATE MODEL `bqml_tutorial.natality_model`
OPTIONS
(model_type='linear_reg',
input_label_cols=['weight_pounds']) AS
SELECT
weight_pounds,
is_male,
gestation_weeks,
mother_age,
CAST(mother_race AS string) AS mother_race
FROM
`bigquery-public-data.samples.natality`
WHERE
weight_pounds IS NOT NULL
AND RAND() < 0.001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment