@pikaa-ai/pikaa 0.3.23 → 0.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/brand/orbit-logo-option4-whale.jpg +0 -0
- package/assets/brand/orbit-logo.jpg +0 -0
- package/assets/brand/orbit-logo.png +0 -0
- package/assets/brand/orbit-logo.svg +3 -0
- package/dist/cli.js +337 -162
- package/dist/index.js +1 -2
- package/package.json +1 -2
- package/skills/adaptyv/SKILL.md +0 -240
- package/skills/aeon/SKILL.md +0 -402
- package/skills/analytical-method-validation/SKILL.md +0 -299
- package/skills/anndata/SKILL.md +0 -431
- package/skills/arbor/SKILL.md +0 -152
- package/skills/arboreto/SKILL.md +0 -267
- package/skills/astropy/SKILL.md +0 -353
- package/skills/autoskill/SKILL.md +0 -233
- package/skills/benchling-integration/SKILL.md +0 -229
- package/skills/bgpt-paper-search/SKILL.md +0 -75
- package/skills/bids/SKILL.md +0 -237
- package/skills/biopython/SKILL.md +0 -472
- package/skills/bioservices/SKILL.md +0 -399
- package/skills/bulk-rnaseq/SKILL.md +0 -198
- package/skills/cellxgene-census/SKILL.md +0 -283
- package/skills/cirq/SKILL.md +0 -370
- package/skills/citation-management/SKILL.md +0 -329
- package/skills/clinical-decision-support/SKILL.md +0 -238
- package/skills/clinical-decision-support/references/README.md +0 -62
- package/skills/clinical-reports/SKILL.md +0 -248
- package/skills/clinical-reports/references/README.md +0 -34
- package/skills/cobrapy/SKILL.md +0 -496
- package/skills/consciousness-council/SKILL.md +0 -151
- package/skills/dask/SKILL.md +0 -482
- package/skills/database-lookup/SKILL.md +0 -386
- package/skills/datamol/SKILL.md +0 -200
- package/skills/deepchem/SKILL.md +0 -244
- package/skills/deepspot-m/SKILL.md +0 -175
- package/skills/deeptools/SKILL.md +0 -412
- package/skills/depmap/SKILL.md +0 -301
- package/skills/dhdna-profiler/SKILL.md +0 -184
- package/skills/diffdock/SKILL.md +0 -488
- package/skills/dnanexus-integration/SKILL.md +0 -325
- package/skills/docx/SKILL.md +0 -99
- package/skills/esm/SKILL.md +0 -334
- package/skills/etetoolkit/SKILL.md +0 -327
- package/skills/exa-search/SKILL.md +0 -102
- package/skills/executing-plans/SKILL.md +0 -14
- package/skills/experimental-design/SKILL.md +0 -234
- package/skills/exploratory-data-analysis/SKILL.md +0 -280
- package/skills/flowio/SKILL.md +0 -310
- package/skills/fluidsim/SKILL.md +0 -279
- package/skills/frontend-design/SKILL.md +0 -100
- package/skills/generate-image/SKILL.md +0 -304
- package/skills/geniml/SKILL.md +0 -310
- package/skills/genomic-coordinates/SKILL.md +0 -189
- package/skills/genomic-intelligence/SKILL.md +0 -243
- package/skills/geomaster/README.md +0 -105
- package/skills/geomaster/SKILL.md +0 -366
- package/skills/geopandas/SKILL.md +0 -250
- package/skills/get-available-resources/SKILL.md +0 -260
- package/skills/gget/SKILL.md +0 -153
- package/skills/ginkgo-cloud-lab/SKILL.md +0 -106
- package/skills/glycoengineering/SKILL.md +0 -339
- package/skills/gtars/SKILL.md +0 -282
- package/skills/guardian-rails/SKILL.md +0 -54
- package/skills/histolab/SKILL.md +0 -243
- package/skills/hugging-science/SKILL.md +0 -132
- package/skills/hypogenic/SKILL.md +0 -290
- package/skills/hypothesis-generation/SKILL.md +0 -264
- package/skills/imaging-data-commons/SKILL.md +0 -496
- package/skills/infographics/SKILL.md +0 -315
- package/skills/iso-standards-readiness/SKILL.md +0 -352
- package/skills/lab-hardware-cad/SKILL.md +0 -372
- package/skills/labarchive-integration/SKILL.md +0 -216
- package/skills/lamindb/SKILL.md +0 -408
- package/skills/latchbio-integration/SKILL.md +0 -227
- package/skills/latex-posters/SKILL.md +0 -369
- package/skills/latex-posters/references/README.md +0 -439
- package/skills/liteparse/SKILL.md +0 -295
- package/skills/literature-review/SKILL.md +0 -263
- package/skills/markdown-mermaid-writing/SKILL.md +0 -322
- package/skills/market-research-reports/SKILL.md +0 -337
- package/skills/markitdown/SKILL.md +0 -264
- package/skills/matchms/SKILL.md +0 -276
- package/skills/matlab/SKILL.md +0 -274
- package/skills/matplotlib/SKILL.md +0 -378
- package/skills/medchem/SKILL.md +0 -321
- package/skills/modal/SKILL.md +0 -468
- package/skills/molecular-dynamics/SKILL.md +0 -458
- package/skills/molfeat/SKILL.md +0 -348
- package/skills/ncats-arax/SKILL.md +0 -178
- package/skills/networkx/SKILL.md +0 -440
- package/skills/neurokit2/SKILL.md +0 -323
- package/skills/neuropixels-analysis/SKILL.md +0 -412
- package/skills/nextflow/SKILL.md +0 -195
- package/skills/omero-integration/SKILL.md +0 -222
- package/skills/onekgpd/SKILL.md +0 -371
- package/skills/ontology-term-resolution/SKILL.md +0 -147
- package/skills/open-notebook/SKILL.md +0 -297
- package/skills/openpiv/SKILL.md +0 -469
- package/skills/opentrons-integration/SKILL.md +0 -322
- package/skills/optimize-for-gpu/SKILL.md +0 -176
- package/skills/owasp-top10/SKILL.md +0 -48
- package/skills/pacsomatic/LICENSE +0 -21
- package/skills/pacsomatic/SKILL.md +0 -150
- package/skills/paper-lookup/SKILL.md +0 -263
- package/skills/paperclip/SKILL.md +0 -413
- package/skills/paperzilla/SKILL.md +0 -159
- package/skills/parallel-web/SKILL.md +0 -128
- package/skills/pathml/SKILL.md +0 -222
- package/skills/pathogen-variant-surveillance/SKILL.md +0 -208
- package/skills/pathway-enrichment/SKILL.md +0 -194
- package/skills/pdf/SKILL.md +0 -322
- package/skills/peer-review/SKILL.md +0 -288
- package/skills/penetration-testing/SKILL.md +0 -31
- package/skills/pennylane/SKILL.md +0 -240
- package/skills/phylogenetics/SKILL.md +0 -409
- package/skills/pi-agent/SKILL.md +0 -83
- package/skills/pkpd-modeling/SKILL.md +0 -381
- package/skills/polars/SKILL.md +0 -393
- package/skills/polars-bio/SKILL.md +0 -379
- package/skills/ponytail/SKILL.md +0 -31
- package/skills/ponytail-audit/SKILL.md +0 -18
- package/skills/pptx/SKILL.md +0 -246
- package/skills/pptx-posters/SKILL.md +0 -258
- package/skills/primekg/SKILL.md +0 -99
- package/skills/protocolsio-integration/SKILL.md +0 -236
- package/skills/pufferlib/SKILL.md +0 -328
- package/skills/pydeseq2/SKILL.md +0 -369
- package/skills/pydicom/SKILL.md +0 -381
- package/skills/pyhealth/SKILL.md +0 -124
- package/skills/pylabrobot/SKILL.md +0 -216
- package/skills/pymatgen/SKILL.md +0 -404
- package/skills/pymc/SKILL.md +0 -310
- package/skills/pymoo/SKILL.md +0 -276
- package/skills/pyopenms/SKILL.md +0 -179
- package/skills/pysam/SKILL.md +0 -330
- package/skills/pytdc/SKILL.md +0 -297
- package/skills/pytorch-lightning/SKILL.md +0 -191
- package/skills/pyzotero/SKILL.md +0 -137
- package/skills/qiskit/SKILL.md +0 -259
- package/skills/qutip/SKILL.md +0 -317
- package/skills/rdkit/SKILL.md +0 -94
- package/skills/relsa-severity-assessment/SKILL.md +0 -354
- package/skills/research-grants/SKILL.md +0 -296
- package/skills/research-grants/references/README.md +0 -287
- package/skills/research-lookup/README.md +0 -106
- package/skills/research-lookup/SKILL.md +0 -338
- package/skills/rowan/SKILL.md +0 -398
- package/skills/scanpy/SKILL.md +0 -303
- package/skills/scholar-evaluation/SKILL.md +0 -296
- package/skills/scientific-brainstorming/SKILL.md +0 -282
- package/skills/scientific-critical-thinking/SKILL.md +0 -180
- package/skills/scientific-schematics/SKILL.md +0 -370
- package/skills/scientific-slides/SKILL.md +0 -379
- package/skills/scientific-visualization/SKILL.md +0 -285
- package/skills/scientific-writing/SKILL.md +0 -356
- package/skills/scikit-bio/SKILL.md +0 -470
- package/skills/scikit-learn/SKILL.md +0 -324
- package/skills/scikit-survival/SKILL.md +0 -313
- package/skills/scvelo/SKILL.md +0 -328
- package/skills/scvi-tools/SKILL.md +0 -201
- package/skills/seaborn/SKILL.md +0 -254
- package/skills/security-auditor/SKILL.md +0 -37
- package/skills/shap/SKILL.md +0 -282
- package/skills/simpy/SKILL.md +0 -283
- package/skills/stable-baselines3/SKILL.md +0 -325
- package/skills/statistical-analysis/SKILL.md +0 -446
- package/skills/statistical-power/SKILL.md +0 -200
- package/skills/statsmodels/SKILL.md +0 -238
- package/skills/sympy/SKILL.md +0 -354
- package/skills/systematic-debugging/SKILL.md +0 -35
- package/skills/tamarind/SKILL.md +0 -285
- package/skills/tdd/SKILL.md +0 -26
- package/skills/tiledbvcf/SKILL.md +0 -456
- package/skills/timesfm-forecasting/SKILL.md +0 -408
- package/skills/timesfm-forecasting/examples/global-temperature/README.md +0 -178
- package/skills/torch-geometric/SKILL.md +0 -458
- package/skills/torchdrug/SKILL.md +0 -241
- package/skills/transformers/SKILL.md +0 -195
- package/skills/treatment-plans/SKILL.md +0 -174
- package/skills/treatment-plans/references/README.md +0 -19
- package/skills/umap-learn/SKILL.md +0 -488
- package/skills/uncertainty-and-units/SKILL.md +0 -384
- package/skills/usfiscaldata/SKILL.md +0 -171
- package/skills/vaex/SKILL.md +0 -204
- package/skills/venue-templates/SKILL.md +0 -269
- package/skills/verification-before-completion/SKILL.md +0 -22
- package/skills/waypoint-bio/SKILL.md +0 -273
- package/skills/what-if-oracle/SKILL.md +0 -184
- package/skills/writing-plans/SKILL.md +0 -15
- package/skills/xlsx/SKILL.md +0 -110
- package/skills/zarr-python/SKILL.md +0 -241
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: timesfm-forecasting
|
|
3
|
-
description: Zero-shot time series forecasting with Google's TimesFM foundation model. Use for any univariate time series (sales, sensors, energy, vitals, weather) without training a custom model. Supports CSV/DataFrame/array inputs with point forecasts and prediction intervals. Includes a preflight system checker script to verify RAM/GPU before first use.
|
|
4
|
-
allowed-tools: Read Write Edit Bash
|
|
5
|
-
license: Apache-2.0 license
|
|
6
|
-
metadata:
|
|
7
|
-
version: "1.2"
|
|
8
|
-
skill-author: Clayton Young / Superior Byte Works, LLC (@borealBytes)
|
|
9
|
-
skill-version: 1.0.0
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# TimesFM Forecasting
|
|
13
|
-
|
|
14
|
-
## Overview
|
|
15
|
-
|
|
16
|
-
TimesFM (Time Series Foundation Model) is a pretrained decoder-only foundation model
|
|
17
|
-
developed by Google Research for time-series forecasting. It works **zero-shot** — feed it
|
|
18
|
-
any univariate time series and it returns point forecasts with calibrated quantile
|
|
19
|
-
prediction intervals, no training required.
|
|
20
|
-
|
|
21
|
-
This skill wraps TimesFM for safe, agent-friendly local inference. It includes a
|
|
22
|
-
**mandatory preflight system checker** that verifies RAM, GPU memory, and disk space
|
|
23
|
-
before the model is ever loaded so the agent never crashes a user's machine.
|
|
24
|
-
|
|
25
|
-
> **Key numbers**: TimesFM 2.5 uses 200M parameters (~800 MB on disk, ~1.5 GB in RAM on
|
|
26
|
-
> CPU, ~1 GB VRAM on GPU). The archived v1/v2 500M-parameter model needs ~32 GB RAM.
|
|
27
|
-
> Always run the system checker first.
|
|
28
|
-
|
|
29
|
-
## When to Use This Skill
|
|
30
|
-
|
|
31
|
-
Use this skill when:
|
|
32
|
-
|
|
33
|
-
- Forecasting **any univariate time series** (sales, demand, sensor, vitals, price, weather)
|
|
34
|
-
- You need **zero-shot forecasting** without training a custom model
|
|
35
|
-
- You want **probabilistic forecasts** with calibrated prediction intervals (quantiles)
|
|
36
|
-
- You have time series of **any length** (the model handles 1–16,384 context points)
|
|
37
|
-
- You need to **batch-forecast** hundreds or thousands of series efficiently
|
|
38
|
-
- You want a **foundation model** approach instead of hand-tuning ARIMA/ETS parameters
|
|
39
|
-
|
|
40
|
-
Do **not** use this skill when:
|
|
41
|
-
|
|
42
|
-
- You need classical statistical models with coefficient interpretation → use `statsmodels`
|
|
43
|
-
- You need time series classification or clustering → use `aeon`
|
|
44
|
-
- You need multivariate vector autoregression or Granger causality → use `statsmodels`
|
|
45
|
-
- Your data is tabular (not temporal) → use `scikit-learn`
|
|
46
|
-
|
|
47
|
-
> **Note on Anomaly Detection**: TimesFM does not have built-in anomaly detection, but you can
|
|
48
|
-
> use the **quantile forecasts as prediction intervals** — values outside the 90% CI (q10–q90)
|
|
49
|
-
> are statistically unusual. See the `examples/anomaly-detection/` directory for a full example.
|
|
50
|
-
|
|
51
|
-
## ⚠️ Mandatory Preflight: System Requirements Check
|
|
52
|
-
|
|
53
|
-
**CRITICAL — ALWAYS run the system checker before loading the model for the first time.**
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
python scripts/check_system.py
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
This script checks:
|
|
60
|
-
|
|
61
|
-
1. **Available RAM** — warns if below 4 GB, blocks if below 2 GB
|
|
62
|
-
2. **GPU availability** — detects CUDA/MPS devices and VRAM
|
|
63
|
-
3. **Disk space** — verifies room for the ~800 MB model download
|
|
64
|
-
4. **Python version** — requires 3.10+
|
|
65
|
-
5. **Existing installation** — checks if `timesfm` and `torch` are installed
|
|
66
|
-
|
|
67
|
-
> **Note:** Model weights are **NOT stored in this repository**. TimesFM weights (~800 MB)
|
|
68
|
-
> download on-demand from HuggingFace on first use and cache in `~/.cache/huggingface/`.
|
|
69
|
-
> The preflight checker ensures sufficient resources before any download begins.
|
|
70
|
-
|
|
71
|
-
```mermaid
|
|
72
|
-
flowchart TD
|
|
73
|
-
accTitle: Preflight System Check
|
|
74
|
-
accDescr: Decision flowchart showing the system requirement checks that must pass before loading TimesFM.
|
|
75
|
-
|
|
76
|
-
start["🚀 Run check_system.py"] --> ram{"RAM ≥ 4 GB?"}
|
|
77
|
-
ram -->|"Yes"| gpu{"GPU available?"}
|
|
78
|
-
ram -->|"No (2-4 GB)"| warn_ram["⚠️ Warning: tight RAM<br/>CPU-only, small batches"]
|
|
79
|
-
ram -->|"No (< 2 GB)"| block["🛑 BLOCKED<br/>Insufficient memory"]
|
|
80
|
-
warn_ram --> disk
|
|
81
|
-
gpu -->|"CUDA / MPS"| vram{"VRAM ≥ 2 GB?"}
|
|
82
|
-
gpu -->|"CPU only"| cpu_ok["✅ CPU mode<br/>Slower but works"]
|
|
83
|
-
vram -->|"Yes"| gpu_ok["✅ GPU mode<br/>Fast inference"]
|
|
84
|
-
vram -->|"No"| cpu_ok
|
|
85
|
-
gpu_ok --> disk{"Disk ≥ 2 GB free?"}
|
|
86
|
-
cpu_ok --> disk
|
|
87
|
-
disk -->|"Yes"| ready["✅ READY<br/>Safe to load model"]
|
|
88
|
-
disk -->|"No"| block_disk["🛑 BLOCKED<br/>Need space for weights"]
|
|
89
|
-
|
|
90
|
-
classDef ok fill:#dcfce7,stroke:#16a34a,stroke-width:2px,color:#14532d
|
|
91
|
-
classDef warn fill:#fef9c3,stroke:#ca8a04,stroke-width:2px,color:#713f12
|
|
92
|
-
classDef block fill:#fee2e2,stroke:#dc2626,stroke-width:2px,color:#7f1d1d
|
|
93
|
-
classDef neutral fill:#f3f4f6,stroke:#6b7280,stroke-width:2px,color:#1f2937
|
|
94
|
-
|
|
95
|
-
class ready,gpu_ok,cpu_ok ok
|
|
96
|
-
class warn_ram warn
|
|
97
|
-
class block,block_disk block
|
|
98
|
-
class start,ram,gpu,vram,disk neutral
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Hardware Requirements by Model Version
|
|
102
|
-
|
|
103
|
-
| Model | Parameters | RAM (CPU) | VRAM (GPU) | Disk | Context |
|
|
104
|
-
| ----- | ---------- | --------- | ---------- | ---- | ------- |
|
|
105
|
-
| **TimesFM 2.5** (recommended) | 200M | ≥ 4 GB | ≥ 2 GB | ~800 MB | up to 16,384 |
|
|
106
|
-
| TimesFM 2.0 (archived) | 500M | ≥ 16 GB | ≥ 8 GB | ~2 GB | up to 2,048 |
|
|
107
|
-
| TimesFM 1.0 (archived) | 200M | ≥ 8 GB | ≥ 4 GB | ~800 MB | up to 2,048 |
|
|
108
|
-
|
|
109
|
-
> **Recommendation**: Always use TimesFM 2.5 unless you have a specific reason to use an
|
|
110
|
-
> older checkpoint. It is smaller, faster, and supports 8× longer context.
|
|
111
|
-
|
|
112
|
-
## 🔧 Installation
|
|
113
|
-
|
|
114
|
-
### Step 1: Verify System (always first)
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
python scripts/check_system.py
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Step 2: Install TimesFM
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
# Using uv (recommended by this repo)
|
|
124
|
-
uv pip install timesfm[torch]
|
|
125
|
-
|
|
126
|
-
# For JAX/Flax backend (faster on TPU/GPU)
|
|
127
|
-
uv pip install timesfm[flax]
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Step 3: Install PyTorch for Your Hardware
|
|
131
|
-
|
|
132
|
-
```bash
|
|
133
|
-
# CUDA 12.1 (NVIDIA GPU)
|
|
134
|
-
uv pip install torch>=2.0.0 --index-url https://download.pytorch.org/whl/cu121
|
|
135
|
-
|
|
136
|
-
# CPU only
|
|
137
|
-
uv pip install torch>=2.0.0 --index-url https://download.pytorch.org/whl/cpu
|
|
138
|
-
|
|
139
|
-
# Apple Silicon (MPS)
|
|
140
|
-
uv pip install torch>=2.0.0 # MPS support is built-in
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### Step 4: Verify Installation
|
|
144
|
-
|
|
145
|
-
```python
|
|
146
|
-
import timesfm
|
|
147
|
-
import numpy as np
|
|
148
|
-
print(f"TimesFM version: {timesfm.__version__}")
|
|
149
|
-
print("Installation OK")
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## 🎯 Quick Start
|
|
153
|
-
|
|
154
|
-
### Minimal Example (5 Lines)
|
|
155
|
-
|
|
156
|
-
```python
|
|
157
|
-
import torch, numpy as np, timesfm
|
|
158
|
-
|
|
159
|
-
torch.set_float32_matmul_precision("high")
|
|
160
|
-
|
|
161
|
-
model = timesfm.TimesFM_2p5_200M_torch.from_pretrained(
|
|
162
|
-
"google/timesfm-2.5-200m-pytorch"
|
|
163
|
-
)
|
|
164
|
-
model.compile(timesfm.ForecastConfig(
|
|
165
|
-
max_context=1024, max_horizon=256, normalize_inputs=True,
|
|
166
|
-
use_continuous_quantile_head=True, force_flip_invariance=True,
|
|
167
|
-
infer_is_positive=True, fix_quantile_crossing=True,
|
|
168
|
-
))
|
|
169
|
-
|
|
170
|
-
point, quantiles = model.forecast(horizon=24, inputs=[
|
|
171
|
-
np.sin(np.linspace(0, 20, 200)), # any 1-D array
|
|
172
|
-
])
|
|
173
|
-
# point.shape == (1, 24) — median forecast
|
|
174
|
-
# quantiles.shape == (1, 24, 10) — 10th–90th percentile bands
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Forecast from CSV
|
|
178
|
-
|
|
179
|
-
```python
|
|
180
|
-
import pandas as pd, numpy as np
|
|
181
|
-
|
|
182
|
-
df = pd.read_csv("monthly_sales.csv", parse_dates=["date"], index_col="date")
|
|
183
|
-
|
|
184
|
-
# Convert each column to a list of arrays
|
|
185
|
-
inputs = [df[col].dropna().values.astype(np.float32) for col in df.columns]
|
|
186
|
-
|
|
187
|
-
point, quantiles = model.forecast(horizon=12, inputs=inputs)
|
|
188
|
-
|
|
189
|
-
# Build a results DataFrame
|
|
190
|
-
for i, col in enumerate(df.columns):
|
|
191
|
-
last_date = df[col].dropna().index[-1]
|
|
192
|
-
future_dates = pd.date_range(last_date, periods=13, freq="MS")[1:]
|
|
193
|
-
forecast_df = pd.DataFrame({
|
|
194
|
-
"date": future_dates,
|
|
195
|
-
"forecast": point[i],
|
|
196
|
-
"lower_80": quantiles[i, :, 2], # 20th percentile
|
|
197
|
-
"upper_80": quantiles[i, :, 8], # 80th percentile
|
|
198
|
-
})
|
|
199
|
-
print(f"\n--- {col} ---")
|
|
200
|
-
print(forecast_df.to_string(index=False))
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### Forecast with Covariates (XReg)
|
|
204
|
-
|
|
205
|
-
TimesFM 2.5+ supports exogenous variables through `forecast_with_covariates()`. Requires `timesfm[xreg]`.
|
|
206
|
-
|
|
207
|
-
```python
|
|
208
|
-
# Requires: uv pip install timesfm[xreg]
|
|
209
|
-
point, quantiles = model.forecast_with_covariates(
|
|
210
|
-
inputs=inputs,
|
|
211
|
-
dynamic_numerical_covariates={"price": price_arrays},
|
|
212
|
-
dynamic_categorical_covariates={"holiday": holiday_arrays},
|
|
213
|
-
static_categorical_covariates={"region": region_labels},
|
|
214
|
-
xreg_mode="xreg + timesfm", # or "timesfm + xreg"
|
|
215
|
-
)
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
| Covariate Type | Description | Example |
|
|
219
|
-
| -------------- | ----------- | ------- |
|
|
220
|
-
| `dynamic_numerical` | Time-varying numeric | price, temperature, promotion spend |
|
|
221
|
-
| `dynamic_categorical` | Time-varying categorical | holiday flag, day of week |
|
|
222
|
-
| `static_numerical` | Per-series numeric | store size, account age |
|
|
223
|
-
| `static_categorical` | Per-series categorical | store type, region, product category |
|
|
224
|
-
|
|
225
|
-
**XReg Modes:**
|
|
226
|
-
- `"xreg + timesfm"` (default): TimesFM forecasts first, then XReg adjusts residuals
|
|
227
|
-
- `"timesfm + xreg"`: XReg fits first, then TimesFM forecasts residuals
|
|
228
|
-
|
|
229
|
-
> See `examples/covariates-forecasting/` for a complete example with synthetic retail data.
|
|
230
|
-
|
|
231
|
-
### Anomaly Detection (via Quantile Intervals)
|
|
232
|
-
|
|
233
|
-
TimesFM does not have built-in anomaly detection, but the **quantile forecasts naturally provide
|
|
234
|
-
prediction intervals** that can detect anomalies:
|
|
235
|
-
|
|
236
|
-
```python
|
|
237
|
-
point, q = model.forecast(horizon=H, inputs=[values])
|
|
238
|
-
|
|
239
|
-
# 90% prediction interval
|
|
240
|
-
lower_90 = q[0, :, 1] # 10th percentile
|
|
241
|
-
upper_90 = q[0, :, 9] # 90th percentile
|
|
242
|
-
|
|
243
|
-
# Detect anomalies: values outside the 90% CI
|
|
244
|
-
actual = test_values # your holdout data
|
|
245
|
-
anomalies = (actual < lower_90) | (actual > upper_90)
|
|
246
|
-
|
|
247
|
-
# Severity levels
|
|
248
|
-
is_warning = (actual < q[0, :, 2]) | (actual > q[0, :, 8]) # outside 80% CI
|
|
249
|
-
is_critical = anomalies # outside 90% CI
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
| Severity | Condition | Interpretation |
|
|
253
|
-
| -------- | --------- | -------------- |
|
|
254
|
-
| **Normal** | Inside 80% CI | Expected behavior |
|
|
255
|
-
| **Warning** | Outside 80% CI | Unusual but possible |
|
|
256
|
-
| **Critical** | Outside 90% CI | Statistically rare (< 10% probability) |
|
|
257
|
-
|
|
258
|
-
> See `examples/anomaly-detection/` for a complete example with visualization.
|
|
259
|
-
|
|
260
|
-
```python
|
|
261
|
-
# Requires: uv pip install timesfm[xreg]
|
|
262
|
-
point, quantiles = model.forecast_with_covariates(
|
|
263
|
-
inputs=inputs,
|
|
264
|
-
dynamic_numerical_covariates={"temperature": temp_arrays},
|
|
265
|
-
dynamic_categorical_covariates={"day_of_week": dow_arrays},
|
|
266
|
-
static_categorical_covariates={"region": region_labels},
|
|
267
|
-
xreg_mode="xreg + timesfm", # or "timesfm + xreg"
|
|
268
|
-
)
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
## Output, Configuration, Workflows, and Tuning
|
|
272
|
-
|
|
273
|
-
- [references/output_and_config.md](references/output_and_config.md): reading the point
|
|
274
|
-
forecast and the 10 quantile bands, deriving prediction intervals, and every
|
|
275
|
-
`ForecastConfig` field.
|
|
276
|
-
- [references/workflows.md](references/workflows.md): the standard forecast sequence,
|
|
277
|
-
many-series forecasting from a wide CSV, and backtesting with interval coverage.
|
|
278
|
-
- [references/performance_tuning.md](references/performance_tuning.md): GPU and TF32
|
|
279
|
-
setup, `per_core_batch_size` by available memory, and memory management.
|
|
280
|
-
- [references/examples_and_validation.md](references/examples_and_validation.md):
|
|
281
|
-
runnable examples, the quality checklist, common mistakes, and regression checks.
|
|
282
|
-
|
|
283
|
-
## 🔗 Integration with Other Skills
|
|
284
|
-
|
|
285
|
-
### With `statsmodels`
|
|
286
|
-
|
|
287
|
-
Use `statsmodels` for classical models (ARIMA, SARIMAX) as a **comparison baseline**:
|
|
288
|
-
|
|
289
|
-
```python
|
|
290
|
-
# TimesFM forecast
|
|
291
|
-
tfm_point, tfm_q = model.forecast(horizon=H, inputs=[values])
|
|
292
|
-
|
|
293
|
-
# statsmodels ARIMA forecast
|
|
294
|
-
from statsmodels.tsa.arima.model import ARIMA
|
|
295
|
-
arima = ARIMA(values, order=(1,1,1)).fit()
|
|
296
|
-
arima_forecast = arima.forecast(steps=H)
|
|
297
|
-
|
|
298
|
-
# Compare
|
|
299
|
-
print(f"TimesFM MAE: {np.mean(np.abs(actual - tfm_point[0])):.2f}")
|
|
300
|
-
print(f"ARIMA MAE: {np.mean(np.abs(actual - arima_forecast)):.2f}")
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
### With `matplotlib` / `scientific-visualization`
|
|
304
|
-
|
|
305
|
-
Plot forecasts with prediction intervals as publication-quality figures.
|
|
306
|
-
|
|
307
|
-
### With `exploratory-data-analysis`
|
|
308
|
-
|
|
309
|
-
Run EDA on the time series before forecasting to understand trends, seasonality, and stationarity.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
## 📚 Available Scripts
|
|
316
|
-
|
|
317
|
-
### `scripts/check_system.py`
|
|
318
|
-
|
|
319
|
-
**Mandatory preflight checker.** Run before first model load.
|
|
320
|
-
|
|
321
|
-
```bash
|
|
322
|
-
python scripts/check_system.py
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
Output example:
|
|
326
|
-
```
|
|
327
|
-
=== TimesFM System Requirements Check ===
|
|
328
|
-
|
|
329
|
-
[RAM] Total: 32.0 GB | Available: 24.3 GB ✅ PASS
|
|
330
|
-
[GPU] NVIDIA RTX 4090 | VRAM: 24.0 GB ✅ PASS
|
|
331
|
-
[Disk] Free: 142.5 GB ✅ PASS
|
|
332
|
-
[Python] 3.12.1 ✅ PASS
|
|
333
|
-
[timesfm] Installed (2.5.0) ✅ PASS
|
|
334
|
-
[torch] Installed (2.4.1+cu121) ✅ PASS
|
|
335
|
-
|
|
336
|
-
VERDICT: ✅ System is ready for TimesFM 2.5 (GPU mode)
|
|
337
|
-
Recommended: per_core_batch_size=128
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
### `scripts/forecast_csv.py`
|
|
341
|
-
|
|
342
|
-
End-to-end CSV forecasting with automatic system check.
|
|
343
|
-
|
|
344
|
-
```bash
|
|
345
|
-
python scripts/forecast_csv.py input.csv \
|
|
346
|
-
--horizon 24 \
|
|
347
|
-
--date-col date \
|
|
348
|
-
--value-cols sales,revenue \
|
|
349
|
-
--output forecasts.csv
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
## 📖 Reference Documentation
|
|
353
|
-
|
|
354
|
-
Detailed guides in `references/`:
|
|
355
|
-
|
|
356
|
-
| File | Contents |
|
|
357
|
-
| ---- | -------- |
|
|
358
|
-
| `references/system_requirements.md` | Hardware tiers, GPU/CPU selection, memory estimation formulas |
|
|
359
|
-
| `references/api_reference.md` | Full `ForecastConfig` docs, `from_pretrained` options, output shapes |
|
|
360
|
-
| `references/data_preparation.md` | Input formats, NaN handling, CSV loading, covariate setup |
|
|
361
|
-
|
|
362
|
-
## Common Pitfalls
|
|
363
|
-
|
|
364
|
-
1. **Not running system check** → model load crashes on low-RAM machines. Always run `check_system.py` first.
|
|
365
|
-
2. **Forgetting `model.compile()`** → `RuntimeError: Model is not compiled`. Must call `compile()` before `forecast()`.
|
|
366
|
-
3. **Not setting `normalize_inputs=True`** → unstable forecasts for series with large values.
|
|
367
|
-
4. **Using v1/v2 on machines with < 32 GB RAM** → use TimesFM 2.5 (200M params) instead.
|
|
368
|
-
5. **Not setting `fix_quantile_crossing=True`** → quantiles may not be monotonic (q10 > q50).
|
|
369
|
-
6. **Huge `per_core_batch_size` on small GPU** → CUDA OOM. Start small, increase.
|
|
370
|
-
7. **Passing 2-D arrays** → TimesFM expects a **list of 1-D arrays**, not a 2-D matrix.
|
|
371
|
-
8. **Forgetting `torch.set_float32_matmul_precision("high")`** → slower inference on Ampere+ GPUs.
|
|
372
|
-
9. **Not handling NaN in output** → edge cases with very short series. Always check `np.isnan(point).any()`.
|
|
373
|
-
10. **Using `infer_is_positive=True` for series that can be negative** → clamps forecasts at zero. Set False for temperature, returns, etc.
|
|
374
|
-
|
|
375
|
-
## Model Versions
|
|
376
|
-
|
|
377
|
-
```mermaid
|
|
378
|
-
timeline
|
|
379
|
-
accTitle: TimesFM Version History
|
|
380
|
-
accDescr: Timeline of TimesFM model releases showing parameter counts and key improvements.
|
|
381
|
-
|
|
382
|
-
section 2024
|
|
383
|
-
TimesFM 1.0 : 200M params, 2K context, JAX only
|
|
384
|
-
TimesFM 2.0 : 500M params, 2K context, PyTorch + JAX
|
|
385
|
-
section 2025
|
|
386
|
-
TimesFM 2.5 : 200M params, 16K context, quantile head, no frequency indicator
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
| Version | Params | Context | Quantile Head | Frequency Flag | Status |
|
|
390
|
-
| ------- | ------ | ------- | ------------- | -------------- | ------ |
|
|
391
|
-
| **2.5** | 200M | 16,384 | ✅ Continuous (30M) | ❌ Removed | **Latest** |
|
|
392
|
-
| 2.0 | 500M | 2,048 | ✅ Fixed buckets | ✅ Required | Archived |
|
|
393
|
-
| 1.0 | 200M | 2,048 | ✅ Fixed buckets | ✅ Required | Archived |
|
|
394
|
-
|
|
395
|
-
**Hugging Face checkpoints:**
|
|
396
|
-
|
|
397
|
-
- `google/timesfm-2.5-200m-pytorch` (recommended)
|
|
398
|
-
- `google/timesfm-2.5-200m-flax`
|
|
399
|
-
- `google/timesfm-2.0-500m-pytorch` (archived)
|
|
400
|
-
- `google/timesfm-1.0-200m-pytorch` (archived)
|
|
401
|
-
|
|
402
|
-
## Resources
|
|
403
|
-
|
|
404
|
-
- **Paper**: [A Decoder-Only Foundation Model for Time-Series Forecasting](https://arxiv.org/abs/2310.10688) (ICML 2024)
|
|
405
|
-
- **Repository**: https://github.com/google-research/timesfm
|
|
406
|
-
- **Hugging Face**: https://huggingface.co/collections/google/timesfm-release-66e4be5fdb56e960c1e482a6
|
|
407
|
-
- **Google Blog**: https://research.google/blog/a-decoder-only-foundation-model-for-time-series-forecasting/
|
|
408
|
-
- **BigQuery Integration**: https://cloud.google.com/bigquery/docs/timesfm-model
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
# TimesFM Forecast Report: Global Temperature Anomaly (2025)
|
|
2
|
-
|
|
3
|
-
**Model:** TimesFM 1.0 (200M) PyTorch
|
|
4
|
-
**Generated:** 2026-02-21
|
|
5
|
-
**Source:** NOAA GISTEMP Global Land-Ocean Temperature Index
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Executive Summary
|
|
10
|
-
|
|
11
|
-
TimesFM forecasts a mean temperature anomaly of **1.19°C** for 2025, slightly below the 2024 average of 1.25°C. The model predicts continued elevated temperatures with a peak of 1.30°C in March 2025 and a minimum of 1.06°C in December 2025.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Input Data
|
|
16
|
-
|
|
17
|
-
### Historical Temperature Anomalies (2022-2024)
|
|
18
|
-
|
|
19
|
-
| Date | Anomaly (°C) | Date | Anomaly (°C) | Date | Anomaly (°C) |
|
|
20
|
-
|------|-------------|------|-------------|------|-------------|
|
|
21
|
-
| 2022-01 | 0.89 | 2023-01 | 0.87 | 2024-01 | 1.22 |
|
|
22
|
-
| 2022-02 | 0.89 | 2023-02 | 0.98 | 2024-02 | 1.35 |
|
|
23
|
-
| 2022-03 | 1.02 | 2023-03 | 1.21 | 2024-03 | 1.34 |
|
|
24
|
-
| 2022-04 | 0.88 | 2023-04 | 1.00 | 2024-04 | 1.26 |
|
|
25
|
-
| 2022-05 | 0.85 | 2023-05 | 0.94 | 2024-05 | 1.15 |
|
|
26
|
-
| 2022-06 | 0.88 | 2023-06 | 1.08 | 2024-06 | 1.20 |
|
|
27
|
-
| 2022-07 | 0.88 | 2023-07 | 1.18 | 2024-07 | 1.24 |
|
|
28
|
-
| 2022-08 | 0.90 | 2023-08 | 1.24 | 2024-08 | 1.30 |
|
|
29
|
-
| 2022-09 | 0.88 | 2023-09 | 1.47 | 2024-09 | 1.28 |
|
|
30
|
-
| 2022-10 | 0.95 | 2023-10 | 1.32 | 2024-10 | 1.27 |
|
|
31
|
-
| 2022-11 | 0.77 | 2023-11 | 1.18 | 2024-11 | 1.22 |
|
|
32
|
-
| 2022-12 | 0.78 | 2023-12 | 1.16 | 2024-12 | 1.20 |
|
|
33
|
-
|
|
34
|
-
**Statistics:**
|
|
35
|
-
- Total observations: 36 months
|
|
36
|
-
- Mean anomaly: 1.09°C
|
|
37
|
-
- Trend (2022→2024): +0.37°C
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Raw Forecast Output
|
|
42
|
-
|
|
43
|
-
### Point Forecast and Confidence Intervals
|
|
44
|
-
|
|
45
|
-
| Month | Point | 80% CI | 90% CI |
|
|
46
|
-
|-------|-------|--------|--------|
|
|
47
|
-
| 2025-01 | 1.259 | [1.141, 1.297] | [1.248, 1.324] |
|
|
48
|
-
| 2025-02 | 1.286 | [1.141, 1.340] | [1.277, 1.375] |
|
|
49
|
-
| 2025-03 | 1.295 | [1.127, 1.355] | [1.287, 1.404] |
|
|
50
|
-
| 2025-04 | 1.221 | [1.035, 1.290] | [1.208, 1.331] |
|
|
51
|
-
| 2025-05 | 1.170 | [0.969, 1.239] | [1.153, 1.289] |
|
|
52
|
-
| 2025-06 | 1.146 | [0.942, 1.218] | [1.128, 1.270] |
|
|
53
|
-
| 2025-07 | 1.170 | [0.950, 1.248] | [1.151, 1.300] |
|
|
54
|
-
| 2025-08 | 1.203 | [0.971, 1.284] | [1.186, 1.341] |
|
|
55
|
-
| 2025-09 | 1.191 | [0.959, 1.283] | [1.178, 1.335] |
|
|
56
|
-
| 2025-10 | 1.149 | [0.908, 1.240] | [1.126, 1.287] |
|
|
57
|
-
| 2025-11 | 1.080 | [0.836, 1.176] | [1.062, 1.228] |
|
|
58
|
-
| 2025-12 | 1.061 | [0.802, 1.153] | [1.037, 1.217] |
|
|
59
|
-
|
|
60
|
-
### JSON Output
|
|
61
|
-
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"model": "TimesFM 1.0 (200M) PyTorch",
|
|
65
|
-
"input": {
|
|
66
|
-
"source": "NOAA GISTEMP Global Temperature Anomaly",
|
|
67
|
-
"n_observations": 36,
|
|
68
|
-
"date_range": "2022-01 to 2024-12",
|
|
69
|
-
"mean_anomaly_c": 1.089
|
|
70
|
-
},
|
|
71
|
-
"forecast": {
|
|
72
|
-
"horizon": 12,
|
|
73
|
-
"dates": ["2025-01", "2025-02", "2025-03", "2025-04", "2025-05", "2025-06",
|
|
74
|
-
"2025-07", "2025-08", "2025-09", "2025-10", "2025-11", "2025-12"],
|
|
75
|
-
"point": [1.259, 1.286, 1.295, 1.221, 1.170, 1.146, 1.170, 1.203, 1.191, 1.149, 1.080, 1.061]
|
|
76
|
-
},
|
|
77
|
-
"summary": {
|
|
78
|
-
"forecast_mean_c": 1.186,
|
|
79
|
-
"forecast_max_c": 1.295,
|
|
80
|
-
"forecast_min_c": 1.061,
|
|
81
|
-
"vs_last_year_mean": -0.067
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Visualization
|
|
89
|
-
|
|
90
|
-

|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
## Findings
|
|
95
|
-
|
|
96
|
-
### Key Observations
|
|
97
|
-
|
|
98
|
-
1. **Slight cooling trend expected**: The model forecasts a mean anomaly 0.07°C below 2024 levels, suggesting a potential stabilization after the record-breaking temperatures of 2023-2024.
|
|
99
|
-
|
|
100
|
-
2. **Seasonal pattern preserved**: The forecast shows the expected seasonal variation with higher anomalies in late winter (Feb-Mar) and lower in late fall (Nov-Dec).
|
|
101
|
-
|
|
102
|
-
3. **Widening uncertainty**: The 90% CI expands from ±0.04°C in January to ±0.08°C in December, reflecting typical forecast uncertainty growth over time.
|
|
103
|
-
|
|
104
|
-
4. **Peak temperature**: March 2025 is predicted to have the highest anomaly at 1.30°C, potentially approaching the September 2023 record of 1.47°C.
|
|
105
|
-
|
|
106
|
-
### Limitations
|
|
107
|
-
|
|
108
|
-
- TimesFM is a zero-shot forecaster without physical climate model constraints
|
|
109
|
-
- The 36-month training window may not capture multi-decadal climate trends
|
|
110
|
-
- El Niño/La Niña cycles are not explicitly modeled
|
|
111
|
-
|
|
112
|
-
### Recommendations
|
|
113
|
-
|
|
114
|
-
- Use this forecast as a baseline comparison for physics-based climate models
|
|
115
|
-
- Update forecast quarterly as new observations become available
|
|
116
|
-
- Consider ensemble approaches combining TimesFM with other methods
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Reproducibility
|
|
121
|
-
|
|
122
|
-
### Files
|
|
123
|
-
|
|
124
|
-
| File | Description |
|
|
125
|
-
|------|-------------|
|
|
126
|
-
| `temperature_anomaly.csv` | Input data (36 months) |
|
|
127
|
-
| `forecast_output.csv` | Point forecast with quantiles |
|
|
128
|
-
| `forecast_output.json` | Machine-readable forecast |
|
|
129
|
-
| `forecast_visualization.png` | Fan chart visualization |
|
|
130
|
-
| `run_forecast.py` | Forecasting script |
|
|
131
|
-
| `visualize_forecast.py` | Visualization script |
|
|
132
|
-
| `run_example.sh` | One-click runner |
|
|
133
|
-
|
|
134
|
-
### How to Reproduce
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# Install dependencies
|
|
138
|
-
uv pip install "timesfm[torch]" matplotlib pandas numpy
|
|
139
|
-
|
|
140
|
-
# Run the complete example
|
|
141
|
-
cd skills/timesfm-forecasting/examples/global-temperature
|
|
142
|
-
./run_example.sh
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## Technical Notes
|
|
148
|
-
|
|
149
|
-
### API Discovery
|
|
150
|
-
|
|
151
|
-
The TimesFM PyTorch API differs from the GitHub README documentation:
|
|
152
|
-
|
|
153
|
-
**Documented (GitHub README):**
|
|
154
|
-
```python
|
|
155
|
-
model = timesfm.TimesFm(
|
|
156
|
-
context_len=512,
|
|
157
|
-
horizon_len=128,
|
|
158
|
-
backend="gpu",
|
|
159
|
-
)
|
|
160
|
-
model.load_from_google_repo("google/timesfm-2.5-200m-pytorch")
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
**Actual Working API:**
|
|
164
|
-
```python
|
|
165
|
-
hparams = timesfm.TimesFmHparams(horizon_len=12)
|
|
166
|
-
checkpoint = timesfm.TimesFmCheckpoint(
|
|
167
|
-
huggingface_repo_id="google/timesfm-1.0-200m-pytorch"
|
|
168
|
-
)
|
|
169
|
-
model = timesfm.TimesFm(hparams=hparams, checkpoint=checkpoint)
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### TimesFM 2.5 PyTorch Issue
|
|
173
|
-
|
|
174
|
-
The `google/timesfm-2.5-200m-pytorch` checkpoint downloads as `model.safetensors`, but the TimesFM loader expects `torch_model.ckpt`. This causes a `FileNotFoundError` at model load time. Using TimesFM 1.0 PyTorch resolves this issue.
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
*Report generated by TimesFM Forecasting Skill (scientific-agent-skills)*
|