Forecast any time series with Google's TimesFM 2.5-200M — median path with a ±0.5-quantile confidence band.
| Notebook | Data | Horizon | |
|---|---|---|---|
timesfm.ipynb |
noisy sine + sawtooth | 12 | |
timesfm_crypto.ipynb |
BTC / ETH via yfinance |
250 (~750d) | |
timesfm_weather.ipynb |
temperature via Open-Meteo | 254 (~10.5d) |
All share the same 22-cell pipeline (Global · Data · Execution) — only the Data section differs. The template uses an identity transform; the crypto notebook uses residual-space (Signal = log_return / vol, to_levels = last * exp(cumsum(fcst * vol))); the weather notebook uses an identity transform on raw temperatures.
-
Click Open in Colab on
timesfm.ipynbabove -
Bottom-center → click the Gemini icon → select Gemini 3 Flash
-
Tell it what to forecast. It fetches the data, edits the Sources cell, runs the notebook.
Examples:
- Weather — "Pull hourly temperature for Tokyo last year from Open-Meteo and forecast the next 2 weeks"
- Sales — "Load my Q1–Q3 daily sales CSV from
/content/sales.csvand forecast Q4" - Web traffic — "Fetch daily pageviews for wikipedia.org from the Wikimedia API and forecast 30 days"
-
Chart + confidence band renders inline · PNG saved for GitHub
⚠️ Works great on most time series. Crypto is hard — thetimesfm_crypto.ipynbexample is a demo, not financial advice.
Manual run
Open in Colab (T4 GPU, preconfigured) → Run all. Model loads once, final cell runs the pipeline:
[1/3] Loaded 2 series: BTC-USD, ETH-USD (0.4s)
[2/3] Preparing + inference... done (0.7s)
[3/3] Rendering chart... ✓ total 6.9s
Chart PNG is saved and embedded in the notebook, so it renders on GitHub without re-executing.
A source returns dict[str, pd.Series] with a DatetimeIndex. prepare_all turns each into a DataFrame with Level (history) + Signal (what TimesFM sees). Swap the Sources block, add series to PARAMS, rest runs unchanged.
PARAMS = {
'symbols': [...],
'resample_rule': '3D',
'horizon': 250,
'colors': {...},
'labels': {...},
}- Model —
google/timesfm-2.5-200m-pytorch·max_context=1024·max_horizon=256 - Quantiles — median (q=5) ± 0.5 band (q=4.5 / q=5.5), interpolated across 10 heads
- Chart — 1280×720 log-scale dual-axis Plotly, custom axis labels, dashed median, shaded band, rangeslider
- Deps —
timesfm,plotly>=6.1.1,plotly-geo,kaleido,pandas,numpy+ Chrome/kaleido headless setup (inline) · crypto addsyfinance - Runtime — HuggingFace weights at runtime · GPU via notebook metadata (
gpuType: T4, Python 3.10)
