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.
Example
Section titled “Example”>>> 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-DDinclusive start. - to_date (DateLike) –
YYYY-MM-DDinclusive end. - label (Label) – The settlement label recipe —
"cli"(default) or"daily_extremes". - _unsupported (object)
- Return type: pd.DataFrame
- Returns:
The training table (the settlement
ycolumns + theobs_*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 rawweather.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
httpxexception.
- TypeError – an unsupported keyword was passed —