All skills
google avatar

/bigquery-bigframes

@725ed06
by googlegoogle/skills21k stars
1,698

Generates Python code using BigQuery DataFrames (BigFrames). Use by default for any Python data task involving BigQuery, including data processing, analysis, and machine learning. Don't use for SQL-first workflows or the google-cloud-bigquery client library — use bigquery-basics.

Use this Skill: https://skilld.dev/gh/google/skills/bigquery-bigframes

This session only. Nothing lands on disk.

referenceslogistic_regression.md

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

BigQuery DataFrame Logistic Regression

This example trains a logistic regression model to predict the species of penguins.

import bigframes.pandas as bpd
import bigframes.bigquery as bbq

PROJECT_ID = 'my_project'
DATASET_ID = 'my_dataset'

bpd.options.bigquery.project = PROJECT_ID
bpd.options.bigquery.ordering_mode = 'partial'

# Data Loading
df = bpd.read_gbq("bigquery-public-data.ml_datasets.penguins").dropna()
df['is_adelie'] = df['species'] == "Adelie Penguin (Pygoscelis adeliae)"
df = df.drop(columns=['species'])

# Use `ml.create_model` function from the `bbq` package to train a model.
model_name = f"{PROJECT_ID}.{DATASET_ID}.penguin_species"
model_metadata = bbq.ml.create_model(
    model_name,
    replace=True,
    options={
        "model_type": "LOGISTIC_REG",
    },
    # Explicitly identify the column for prediction
    training_data=df.rename(columns={"is_adelie": "label"})
)
print(model_metadata)

# Use `ml.evaluate` function from the `bbq` package for model evaluation
evaluation = bbq.ml.evaluate(model_name)
print(evaluation)

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill offers comprehensive guidance for utilizing BigQuery DataFrames for analytics and machine learning tasks. It incorporates security-conscious recommendations, such as prioritizing cloud-based computation over local data materialization to ensure better data governance and performance. The patterns provided are consistent with standard professional development workflows in the Google Cloud ecosystem.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at 725ed06. 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 week
metadata
{
  "version": "2.0.0",
  "category": "BigDataAndAnalytics"
}

README badge

README badge for google/skills/bigquery-bigframes