Index of every page on this site: llms.txt
All skills
google avatar

/bigquery-ai-ml

@37de74d
by googlegoogle/adk-python22k stars
4,392
Run it yourself

Leverages BigQuery's built-in machine learning and GenAI capabilities for advanced data analytics. Use when you need to write SQL queries that perform time-series forecasting, predict values, detect outliers or anomalies, find key drivers, perform semantic search or vector search, classify text, calculate similarity, summarize content, translate language, evaluate models, filter by semantic conditions, measure the causal effect of an intervention, compute correlations between columns, detect change points or structural breaks, extract trend or seasonality components, or leverage generative AI capabilities in BigQuery. Do not use for general BigQuery dataset, table, or job management requests.

Use this Skill: https://skilld.dev/gh/google/adk-python/bigquery-ai-ml

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesml_seasonality.md

≈1.7k tokens on demand. Your agent reads this file only when SKILL.md points to it.

BigQuery ML.Seasonality

ML.SEASONALITY is a time-series decomposition function that extracts seasonal components to decouple recurring patterns from the underlying trend and noise.

Syntax Reference

SELECT
  *
FROM
  ML.SEASONALITY(
    { TABLE `project.dataset.table` | (QUERY_STATEMENT) },
    data_col => 'DATA_COL',
    timestamp_col => 'TIMESTAMP_COL'
    [, id_cols => ID_COLS]
    [, seasonalities => SEASONALITIES]
    [, horizon => HORIZON]
  )

Input Arguments

Argument Requirement Type Description
input_data Required The source table or
: : : : query containing :
: : : : historical time series :
: : : : data. :
data_col Required String The name of the numeric
: : : : column in input_data. :
: : : : Supported types: :
: : : : INT64, FLOAT64, :
: : : : NUMERIC, :
: : : : BIGNUMERIC. :
timestamp_col Required String The name of the
: : : : date/timestamp column :
: : : : in input_data. :
: : : : Supported types: :
: : : : DATE, DATETIME, :
: : : : TIMESTAMP. :
id_cols Optional Array<String> The names of the
: : : : grouping columns for :
: : : : multiple series (e.g., :
: : : : ['store_id']). :
: : : : Supported types: :
: : : : STRING, INT64, :
: : : : ARRAY<STRING>, :
: : : : ARRAY<INT64>. :
seasonalities Optional Array<String> Seasonality types to
: : : : extract. Valid values: :
: : : : Yearly, Quarterly, :
: : : : Monthly, Weekly, :
: : : : Daily. If omitted, :
: : : : the function :
: : : : automatically detects :
: : : : all seasonalities. :
horizon Optional Int64 Number of future time
: : : : points to forecast. :
: : : : Default is 0 (history :
: : : : only). Range `[1, :
: : : : 10,000]`. :

Output Schema

Column Type Description
id_cols (As Input) Original identifiers for the series.
[timestamp_col] (As Input) The column name and type match the
: : : input column specified in :
: : : TIMESTAMP_COL. :
[data_col] FLOAT64 The column name matches the input
: : : column specified in DATA_COL. For :
: : : 'history' rows, this contains the :
: : : training data (automatically :
: : : interpolated to resolve any missing :
: : : points). For 'forecast' rows, it :
: : : contains the forecast value. :
time_series_type STRING Label: 'history' or 'forecast'.
yearly FLOAT64 Calculated yearly seasonal component.
: : : A NULL value means no yearly :
: : : seasonality detected. :
quarterly FLOAT64 Calculated quarterly seasonal
: : : component. A NULL value means no :
: : : quarterly seasonality detected. :
monthly FLOAT64 Calculated monthly seasonal component.
: : : A NULL value means no monthly :
: : : seasonality detected. :
weekly FLOAT64 Calculated weekly seasonal component.
: : : A NULL value means no weekly :
: : : seasonality detected. :
daily FLOAT64 Calculated daily seasonal component. A
: : : NULL value means no daily seasonality :
: : : detected. :
status STRING Error messages or empty string on
: : : success. A minimum of 3 data points is :
: : : required. :

Examples

Analyzing Seasonality in Daily Visits

This example analyzes the daily website visits from Google Analytics session data:

WITH DailyVisits AS (
  SELECT
    PARSE_TIMESTAMP('%Y%m%d', date) AS visit_timestamp,
    SUM(totals.visits) AS total_visits
  FROM
    `bigquery-public-data.google_analytics_sample.ga_sessions_*`
  GROUP BY
    visit_timestamp
)
SELECT
  *
FROM
  ML.SEASONALITY(
    TABLE DailyVisits,
    data_col => 'total_visits',
    timestamp_col => 'visit_timestamp'
  );

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill provides a comprehensive interface for BigQuery AI and Machine Learning functions using standard SQL. It includes security considerations regarding the handling of untrusted data within AI-driven queries, which is standard for this type of functionality. Users should apply appropriate data validation when using these features.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: LOW · No issues

Signed by skilld at 37de74d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
metadata
{
  "author": "google-adk",
  "version": "1.0"
}

README badge

README badge for google/adk-python/bigquery-ai-ml