Skip to content

demand_forecasting: enable time dimension + change-tracking note in predictive READMEs#76

Open
pkouki wants to merge 3 commits into
mainfrom
fix/demand-forecasting-time-dimension
Open

demand_forecasting: enable time dimension + change-tracking note in predictive READMEs#76
pkouki wants to merge 3 commits into
mainfrom
fix/demand-forecasting-time-dimension

Conversation

@pkouki
Copy link
Copy Markdown
Contributor

@pkouki pkouki commented May 27, 2026

Summary

Related fixes to the predictive templates, surfaced while running demand_forecasting.py end-to-end:

  1. demand_forecasting.py — enable the time dimension. The script previously set has_time_column=False with a stale "SDK limitation" workaround comment, treating Sale.date as a plain feature. Enabling time properly requires three coordinated changes (otherwise you hit ValueError: expect arity=3 for training/validation sets with has_time_column=True):

    • Set time_col=[Sale.date] on the PropertyTransformer.
    • Make the train/val/test relationships arity-3, carrying the timestamp ({Sale} at {Any:timestamp} has {Any:value}) and binding TrainTable.date / ValTable.date / TestTable.date.
    • Set has_time_column=True on the GNN.
    • Stale comments updated to match.
  2. Add a rai init follow-up note to the predictive template READMEs telling users to add the following to their raiconfig.yaml:

    data:
        ensure_change_tracking: true

    Applied to: demand_forecasting, fraud-detection, smoker_status_prediction, subscriber_retention, telco_network_recovery.

  3. fraud-detection README — add experiment-schema setup DDL. Mirrors the demand_forecasting README: a note under Prerequisites > Access with the SQL to create FRAUD_DETECTION.EXPERIMENTS and grant permissions to the RAI Native App before running the local demo.

  4. Remove transient infra troubleshooting entries. These described temporary server-side states rather than user-actionable template issues:

    • demand_forecasting — "worker is not ready to accept jobs - please retry the job later"
    • subscriber_retention — "Train job stays in QUEUED with no progress"

Notes

I reviewed all predictive scripts across these templates for the same time-dimension issue. demand_forecasting.py was the only script with the arity mismatch. The other temporal scripts (fraud_detection*, retail_planning*) already use arity-3 relationships correctly, and the non-temporal ones (subscriber_retention, telco_network_recovery, smoker_status_prediction*) correctly leave has_time_column=False (static node tasks with non-temporal splits).

Test plan

  • python demand_forecasting.py runs end-to-end with has_time_column=True (no arity error)
  • Validation RMSE is reasonable vs. the predict-the-mean baseline
  • python fraud_detection_local.py runs after the new schema DDL
  • README yaml/sql blocks render correctly (consistent list indentation)

🤖 Generated with Claude Code

…to predictive READMEs

- demand_forecasting.py: enable the temporal GNN path — set time_col on the
  PropertyTransformer, make train/val/test relationships arity-3 (carry
  Sale.date), and set has_time_column=True. Fixes the "expect arity=3 for
  training/validation sets with has_time_column=True" error.
- Add a note after `rai init` across the predictive template READMEs
  (demand_forecasting, fraud-detection, smoker_status_prediction,
  subscriber_retention, telco_network_recovery) telling users to add
  `data.ensure_change_tracking: true` to raiconfig.yaml.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

The docs preview for this pull request has been deployed to Vercel!

✅ Preview: https://relationalai-docs-msiut8k70-relationalai.vercel.app/build/templates
🔍 Inspect: https://vercel.com/relationalai/relationalai-docs/AASkpaoMj9VWybPdYo5a3Psxzohy

Mirrors the demand_forecasting README — tells users to create
FRAUD_DETECTION.EXPERIMENTS and grant permissions to the RAI Native App
before running the local demo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… READMEs

- demand_forecasting: drop "worker is not ready to accept jobs" entry
- subscriber_retention: drop "Train job stays in QUEUED" entry

Both describe transient infra states rather than user-actionable template issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant