Request a demo

Public dataset · Machine learning and samples

BigQuery ML Datasets in BigQuery

The ml_datasets dataset collects small, well-known machine learning tables for BigQuery ML: penguins, iris, US census income, credit card fraud, credit default, bike sharing demand and a holiday calendar for forecasting. The largest table is 67 MiB, so every query bills the 10 MB minimum or close to it.

bigquery-public-data.ml_datasets · Google Cloud · US · Sizes measured November 23, 2026

9tables
81.6 MiBlogical size
371,498rows
under $0.01to scan every column once, on-demand

bigquery-public-data.ml_datasets gathers benchmark tables that BigQuery ML examples and tutorials train on. Google Cloud hosts it; several table descriptions name the original source and license.

penguins (344 rows) and iris (150 rows) are the classic small classification sets. census_adult_income has one row per person with demographics and an income_bracket label, and census_adult_income_kmeans_predictions adds the output columns of a k-means model (CENTROID_ID and distances). ulb_fraud_detection is credit card transactions from two days in September 2013 by European cardholders: per its description, 492 of the 284,807 rows are fraud, and the features V1 to V28 are PCA components, with Time, Amount and the label Class left as is; it is licensed under the Open Database License. credit_card_default has payment history and a default label. bike_sharing_daily and bike_sharing_hourly are Capital Bikeshare rental counts with weather for Washington D.C. in 2011 and 2012, from the UCI ML Repository under CC BY 4.0.

holidays_and_events_for_forecasting is an external table over a CSV file in Cloud Storage. Its description says it holds holiday and event data for training ARIMA_PLUS and ARIMA_PLUS_XREG time series models and does not cover every region or every holiday.

Tables and sizes

TableRowsSizeFull scanLayout
ulb_fraud_detection
Credit card transactions, 492 labeled as fraud.
284,80767.4 MiBunder $0.01None
census_adult_income_kmeans_predictions
census_adult_income with k-means cluster output.
32,5616.5 MiBunder $0.01None
census_adult_income
Census records with an income bracket label.
32,5614.8 MiBunder $0.01None
bike_sharing_hourly
Hourly bike rentals and weather, Washington D.C., 2011 to 2012.
17,3792.3 MiBunder $0.01None
credit_card_default
Credit card clients with a default label.
2,965558 KiBunder $0.01None
bike_sharing_daily
Daily bike rentals and weather, Washington D.C., 2011 to 2012.
73191.4 KiBunder $0.01None
penguins
Penguin measurements by species, island and sex.
34428.3 KiBunder $0.01None
iris
Iris flower measurements by species.
1506.2 KiBunder $0.01None
holidays_and_events_for_forecasting
External table over a CSV in Cloud Storage; BigQuery reports no size for it.
00 Bunder $0.01None

Full scan = every column of the table at the on-demand list price of $6.25 per TiB, before your free TiB each month. Selecting fewer columns costs proportionally less. See BigQuery pricing.

Example queries

Penguin counts and average measurements by species

Scans 17.9 KiB · under $0.01 on-demand

A typical look at class balance before training a classifier. AVG skips the rows with missing measurements.

SELECT
  species,
  COUNT(*) AS penguins,
  ROUND(AVG(body_mass_g)) AS avg_body_mass_g,
  ROUND(AVG(flipper_length_mm), 1) AS avg_flipper_mm
FROM `bigquery-public-data.ml_datasets.penguins`
GROUP BY species
ORDER BY penguins DESC;

Fraud class balance and average amount

Scans 4.3 MiB · under $0.01 on-demand

Shows how imbalanced the label is, which matters for choosing class weights and evaluation metrics.

SELECT
  Class AS is_fraud,
  COUNT(*) AS transactions,
  ROUND(AVG(Amount), 2) AS avg_amount
FROM `bigquery-public-data.ml_datasets.ulb_fraud_detection`
GROUP BY is_fraud;

Share of people earning over 50K by education

Scans 610 KiB · under $0.01 on-demand

Matches the label with LIKE so the query works whatever spacing or punctuation the label values carry.

SELECT
  education,
  COUNT(*) AS people,
  ROUND(COUNTIF(income_bracket LIKE '%>50K%') / COUNT(*), 3) AS share_over_50k
FROM `bigquery-public-data.ml_datasets.census_adult_income`
GROUP BY education
ORDER BY share_over_50k DESC;

Average daily rentals and temperature by season

Scans 17.1 KiB · under $0.01 on-demand

temp is normalized in the source data, not in degrees.

SELECT
  season,
  ROUND(AVG(cnt)) AS avg_daily_rentals,
  ROUND(AVG(temp), 3) AS avg_normalized_temp
FROM `bigquery-public-data.ml_datasets.bike_sharing_daily`
GROUP BY season
ORDER BY season;

Querying it cheaply

  • Every table is small: the largest, ulb_fraud_detection, is 67 MiB. Each query bills at least 10 MB per table referenced, so cost is never the issue here.
  • Training a model with CREATE MODEL is billed under BigQuery ML pricing, not like a plain query, and the model is stored in your own dataset (see BigQuery pricing).
  • The dataset is in the US multi-region. Create the dataset that holds your model in US too, or the query fails with a location error.
  • holidays_and_events_for_forecasting is external, so a dry run cannot estimate it and reports 0 bytes.

FAQ

How much does it cost to query ml_datasets?

Each query bills the 10 MB minimum per table, or slightly more for ulb_fraud_detection (67 MiB). That is a tiny share of the free 1 TiB a month. Training models with BigQuery ML has its own pricing.

Is the BigQuery ml_datasets dataset free?

Yes for storage: the data sits in the bigquery-public-data project and Google pays to store it. You pay for the queries you run from your own project. On-demand, the first 1 TiB scanned each month is free, then you pay per TiB scanned (see BigQuery pricing).

Can I train a BigQuery ML model directly on these tables?

Yes. Use CREATE MODEL your_dataset.model_name OPTIONS (...) AS SELECT ... FROM bigquery-public-data.ml_datasets.penguins. You need write access to your_dataset, and it must be in the US location like the source data.

All public datasets · BigQuery cost queries · Pricing calculator

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.