Skip to content

Add boxoffice-signal-ml-starter: predicting outcomes from public conversation with Cortex AISQL - #289

Open
snowflake-mike-MKTG-IND wants to merge 1 commit into
Snowflake-Labs:mainfrom
snowflake-mike-MKTG-IND:add-boxoffice-signal-ml-starter
Open

Add boxoffice-signal-ml-starter: predicting outcomes from public conversation with Cortex AISQL#289
snowflake-mike-MKTG-IND wants to merge 1 commit into
Snowflake-Labs:mainfrom
snowflake-mike-MKTG-IND:add-boxoffice-signal-ml-starter

Conversation

@snowflake-mike-MKTG-IND

Copy link
Copy Markdown

Summary

Adds samples/boxoffice-signal-ml-starter — a method kit for predicting a commercial outcome from public pre-release conversation, guided end to end by Cortex Code. The worked example is opening-weekend box office, but the pattern applies anywhere public conversation precedes a commercial outcome (game launches, product releases, ticketed events).

The interesting part is not the domain, it's the discipline around the AI:

  • Cortex AISQL intent scoring, not sentiment counting. One consolidated TRY_COMPLETE call classifies each comment into four viewing-intent labels. Independent per-label yes/no calls over-fire — that lesson is baked into the prompt and documented.
  • An evaluation harness for the classifier itself (sql/30_intent_eval.sql): macro-F1 plus a per-class confusion matrix against hand labels. On the reference build, the production scorer measured macro-F1 0.65 while a revised prompt reached 0.85 on the same labels — a gap that is invisible from reading output.
  • As-of feature engineering. Demand percentiles at −21/−14/−7/−3 day horizons where no feature can see past its own prediction date, plus three tripwires in sql/10 that catch it when the filter silently breaks.
  • Strict walk-forward temporal validation with a distributional regressor (CatBoost + ElasticNet blend, residual-mixture prediction intervals, calibrated demand-forward flag), and pedigree features gated behind demand so the model can't lean on hype the audience isn't backing.

Runs in ten minutes with no data

cd samples/boxoffice-signal-ml-starter
pip install -r model/requirements.txt
python model/train_ow_model.py --sample

Synthetic data, no Snowflake connection required — a reviewer can verify the modeling path end to end before wiring up any source.

Data, terms, and privacy

No data is included and no provider is named or endorsed. The sources/ dossiers describe each signal by its characteristics — behavior, access patterns, known failure modes — and CoCo helps the user evaluate options against their own access and each provider's terms. Keys live only in a git-ignored .env (template included, names only), and comment author handles are pseudonymized on ingest.

Checklist

  • New directory under samples/ with a kebab-case name
  • README.md with what it does, prerequisites, and how to run it
  • All source included (7 docs, 5 source dossiers, 5 CoCo skills, 5 SQL files, runnable model)
  • Added to the root README under ML and Data Science
  • No credentials, tokens, account identifiers, or internal object names
  • Verified --sample runs clean from inside the sample directory

A method kit for predicting a commercial outcome from public pre-release
conversation, guided end to end by Cortex Code. Built around Cortex AISQL intent
scoring rather than sentiment counting, with the leakage controls that make the
result trustworthy.

What it demonstrates:
  * AISQL sentiment + 4-label viewing intent in one consolidated TRY_COMPLETE
    call, plus an evaluation harness (macro-F1, per-class confusion) for the
    classifier itself
  * as-of feature engineering: demand percentiles at -21/-14/-7/-3 day horizons
    where no feature can see past its own prediction date, with tripwires that
    catch it when the filter breaks
  * a distributional regressor (CatBoost + ElasticNet, residual-mixture
    intervals, calibrated demand-forward flag) under strict walk-forward
    temporal validation
  * pedigree features gated behind demand so the model cannot lean on hype the
    audience is not backing

Runs with no data and no Snowflake connection via `--sample`, so a contributor
can verify the environment in ten minutes before wiring up any source.

No data is included and no provider is named or endorsed: the sources/ dossiers
describe each signal by its characteristics and CoCo helps the user evaluate
options against their own access and terms. Keys live only in a git-ignored
.env, and comment author handles are pseudonymized on ingest.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant