Skip to content

mostlyright.weather.training_table

mostlyright.weather.training_table(station, from_date, to_date, , label=‘cli’, **_unsupported)

Section titled “mostlyright.weather.training_table(station, from_date, to_date, , label=‘cli’, **_unsupported)”

A built-in supervised-table example: features -> label rows.

Returns one row per station-settlement-day — the label="cli" settlement target (Kalshi NHIGH/NLOW ground truth) beside the observation feature aggregates. The recipe keeps its cutoff fields visible and applies the timing metadata available from its sources. The label="cli" default is EXPLICIT and contractually stable (no FutureWarning, no deprecation path). Two positional dates, inclusive ends. label="daily_extremes" swaps in the Polymarket WU/NOAA-WRH target.

>>> from datetime import date
>>> from mostlyright import weather
>>> table = weather.training_table(
... "KNYC", date(2025, 1, 6), date(2025, 1, 12)
... )
  • Parameters:
    • station (str | list[str] | tuple[str, …]) – A station id (or a list -> a long-format panel).
    • from_date (DateLike) – YYYY-MM-DD inclusive start.
    • to_date (DateLike) – YYYY-MM-DD inclusive end.
    • label (Label) – The settlement label recipe — "cli" (default) or "daily_extremes".
    • _unsupported (object)
  • Return type: pd.DataFrame
  • Returns: The training table (the settlement y columns + the obs_* observation feature aggregates), one row per station-settlement-day.
  • Raises:
    • TypeError – an unsupported keyword was passed — training_table() is capped. For anything beyond the capped surface, compose the raw weather.observations() / weather.forecasts() sources yourself and join them per the feature-engineering doc; the message names that path, never an internal API.
    • HttpError – an upstream fetch (label or observations) failed in transport or with an HTTP error status — never a raw httpx exception.