Skip to main content
  • Date: 2026-11-24
  • Status: Agreed 2026-11-25 (proposed by Mahad); the static page was replaced by 0013 and the account by 0014 (see Later changes)
  • Agreed by: Mahad (2026-11-25), for the team

Context

The live dashboard (decision 0008) only runs on a laptop next to the streaming job. A link that anyone (the markers, the video’s viewers) can open would show the project without setting anything up, and publishing the dataset and model is a sign of a finished project. It had to be free. What we checked on 2026-11-24:
  • Hugging Face Spaces no longer offer Streamlit as a built-in option (since 2025-04-30). Streamlit apps now run as Docker Spaces, and a Space that runs code (Docker or Gradio) needs a paid plan. Static Spaces (HTML, JavaScript and files) are free for everyone.
  • Streamlit Community Cloud is free but deploys only from github.com, and our repo is on github.sfu.ca.
  • Cloudflare Pages is free for static pages too, but would keep the page away from the dataset and model.

Decision

  • Three public Hugging Face repos under one account, made by src/hosting/publish_hf.py, which uploads only with --upload after hf auth login:
    • a dataset: our derived tables (daily signals, event windows, the batch summary and trend, the model’s scores) and the config/ registries;
    • a model: the Spark MLlib PipelineModel with its metrics, feature importance and charts, and a model card;
    • a static Space: the page in hosting/space/ (HTML, CSS, JavaScript, no libraries).
  • No prices, volumes or raw returns are published (Yahoo’s terms), only statistics we computed from them. publish_hf.NOT_PUBLISHED lists the dropped columns, and a test checks it.
  • The page replays recorded output, and says so. A static page cannot run Kafka or Spark. src/hosting/snapshot.py turns the stream’s output into JSON, and the page plays it back day by day. It covers only the model’s test years (2024–2025), since replaying years the model was trained on would flatter it.
  • A second view per event type shows each year’s cumulative abnormal return over days −5..+5, the average, and a straight-line trend through the years extended one year ahead with a 95% prediction interval. Its last day is the CAR, so its slope must equal stats.py’s trend; snapshot.py stops if they differ.
  • It also shows, for the test years, the share of retailers the model flagged on each event day against the share that really moved big. These are shares, because the model’s scores are not calibrated probabilities.

Alternatives considered

  • A Docker Space running the Streamlit app: the same code as decision 0008, but it needs a paid plan.
  • Streamlit Community Cloud: needs a public github.com copy of the repo.
  • stlite (Streamlit in the browser): it would reuse app.py, but loads Python into the page (slow to open) and pins an older Streamlit.
  • Forecasting the next event with the big-move model: it predicts tomorrow from today’s data, so it cannot see a year ahead without that year’s prices. The trend line is labelled as a trend, with its interval.

Consequences

  • New code: src/hosting/snapshot.py, src/hosting/publish_hf.py, hosting/space/ (the page), hosting/cards/ (card templates), tests/test_hosting.py.
  • Settings: common.settings has HOSTING_DIR, SITE_DIR, SITE_DATA_DIR, CARDS_DIR and PUBLISH_DIR. hosting/space/data/ is gitignored.
  • huggingface_hub is added to requirements.txt.
  • No contract changes: the published files are copies of contract datasets, minus the columns in NOT_PUBLISHED.
  • Settled 2026-11-25: published publicly under Mahad’s account (mohummadmahad). The dataset and model are licensed CC BY-NC 4.0, matching the non-commercial terms of the prices behind them.
  • Order of a full refresh: run_everything.sh, then python3 src/hosting/snapshot.py, then python3 src/hosting/publish_hf.py --upload.

Later changes

  • 2026-11-25, decision 0013: the static HTML/JavaScript page is gone. The Space (hosting/space/index.html) embeds the hosted Streamlit dashboard instead, which plays the recording (now hosting/snapshot/, committed) and shows live runs. SITE_DATA_DIR and hosting/space/data/ no longer exist, and NOT_PUBLISHED now lives in hosting.live.
  • 2026-11-25, decision 0014: the dataset, the model and the Space moved from Mahad’s account to the team’s organisation, calendar-effects.
  • 2026-11-25: the Replay view can play any range of years; the model’s test years stay the default, and earlier years carry a warning that the model was trained on them.
  • 2026-11-26: every table in the dataset is Parquet (the viewer could not show the two CSV tables), and publish_hf.py --only uploads just one repository.