Chuyển đến nội dung
Skillpedia
Học máy51k · #3583

timesfm-forecasting

Skill này làm gì

Công cụ này dự đoán các giá trị tương lai của chuỗi thời gian (như doanh số hoặc nhiệt độ) bằng một mô hình AI được huấn luyện sẵn. Nó có thể đưa ra dự báo điểm và khoảng tin cậy.

Khi nào nên dùng

  • ✓Khi dự báo doanh số tương lai của một sản phẩm.
  • ✓Khi ước lượng nhiệt độ cho vài ngày tới.
  • ✓Khi dự báo lưu lượng truy cập website trong tháng tới.

Liên kết skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/timesfm-forecasting/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/timesfm-forecasting/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Dự báo doanh số trong 3 tháng tới dựa trên dữ liệu doanh số lịch sử.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Bạn cung cấp dữ liệu lịch sử theo một định dạng nhất định (như file CSV). Công cụ dùng mô hình TimesFM để phân tích dữ liệu này và tạo dự đoán cho tương lai.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

TimesFM Forecasting

Choose the model/API first

The Python package version is 3.0.2; checkpoint versions are separate.

Checkpoint Interface Quantile output Usage terms
2.5, 200M timesfm.TimesFM_2p5_200M_torch, compile, forecast mean + 9 deciles, median index 5 Apache-2.0 weights; bundled CLI default
3.0, about 330M timesfm3.TimesFM3Forecaster, predict / predict_batch 9 deciles, median index 4 Downloaded weights restricted to non-commercial, non-production use

Upstream identifies 3.0 as the latest model. This skill retains 2.5 as its default local workflow because its Apache-licensed weights have different usage terms. For 3.0 multivariate targets, past-only covariates or Apple MLX, read references/timesfm3.md before adapting code. Authorized Google Cloud services have separate terms; a Cloud entitlement does not change the license of downloaded weights. See the upstream license notice.

Use TimesFM for forecasting an ordered temporal target without task-specific model training. It is not a causal effect estimator, clinical detector, or physics-based climate model. Zero-shot describes fitting; it does not establish absence of benchmark overlap in pretraining or good accuracy in a new domain.

Workflow

  1. Establish cadence, units, forecast origin, horizon, known-at-origin covariates, evaluation cutoffs and a naive/seasonal-naive baseline.
  2. Validate a sorted, unique, regular time grid. Do not dropna() internal gaps: that changes temporal spacing. Reject nonfinite inputs, or explicitly impute inside each training history. Never fill using held-out future targets.
  3. Run python scripts/check_system.py before downloading/loading weights. Its available-RAM and cache-volume thresholds are heuristics, not a guarantee against OOM. Start with batch size 1; measure actual peak usage.
  4. Load the chosen checkpoint with a recorded immutable revision. For 2.5, compile explicit positive context/horizon settings; zero does not mean “use the maximum.” Keep patch-rounded context + horizon <=16,384 and horizon <=1,024 when using the continuous quantile head.
  5. Forecast, validate shapes/finite values/quantile ordering and export the forecast origin, frequency, configuration and checkpoint revision.
  6. Evaluate across rolling origins with preprocessing fitted independently per origin. Report accuracy, interval coverage and interval width by horizon; label quantile intervals nominal until calibrated on relevant data.

Installation

Run in a separate environment. The commands below target the reviewed release. Shell extras and version constraints must be quoted, particularly in zsh.

uv venv .venv-timesfm
uv pip install --python .venv-timesfm/bin/python "timesfm[torch]==3.0.2" numpy pandas
.venv-timesfm/bin/python scripts/check_system.py

Use the current PyTorch installation selector for a CUDA wheel matching the host. The 2.5 loader in this release chooses cuda:0 if CUDA exists, otherwise CPU; detecting MPS does not enable MPS inference. Do not use model.to(...) on the wrapper as if it were an nn.Module. For CPU-only XReg, install jax and scikit-learn alongside the PyTorch profile; the upstream [xreg] extra requests jax[cuda], which is not appropriate for macOS. Flax is a separate optional backend; it is not required by the bundled scripts.

from importlib.metadata import version
import timesfm
print(version("timesfm"))  # package has no guaranteed timesfm.__version__
assert hasattr(timesfm, "TimesFM_2p5_200M_torch")

TimesFM 2.5 quick start

The checkpoint-load examples are illustrative: validation of this refresh used native package code with tiny random models and controlled decode fixtures, without downloading pretrained weights. That verifies mechanics, not accuracy.

import numpy as np
import timesfm

model = timesfm.TimesFM_2p5_200M_torch.from_pretrained(
    "google/timesfm-2.5-200m-pytorch",
    revision="1d952420fba87f3c6dee4f240de0f1a0fbc790e3",
    torch_compile=False,  # avoid compilation startup during an initial smoke run
)
model.compile(timesfm.ForecastConfig(
    max_context=512, max_horizon=128, per_core_batch_size=1,
    normalize_inputs=True, use_continuous_quantile_head=True,

…
Câu hỏi thường gặp

“Zero-shot” nghĩa là gì?

Nghĩa là mô hình có thể dự đoán mà không cần được huấn luyện riêng trên dữ liệu của bạn. Nó dùng kiến thức thu được trong quá trình huấn luyện chung.

Tôi có thể nhận những loại dự báo nào?

Bạn có thể nhận dự báo điểm (giá trị có khả năng nhất) và khoảng tin cậy (khoảng giá trị mà tương lai có khả năng rơi vào).

Tôi có cần phần mềm đặc biệt không?

Có, bạn cần cài một số thư viện Python như “timesfm” và “torch”.

Chi tiết

Mô tả gốc của tác giả

Performs zero-shot time-series forecasting with Google's TimesFM, including regular-grid CSV preparation, quantile forecasts, XReg covariates, and held-out evaluation. Uses the Apache-licensed TimesFM 2.5 checkpoint by default and documents the distinct TimesFM 3.0 multivariate API and weight-license requirements.

repo: K-Dense-AI/scientific-agent-skills

Độ phổ biến

Sao GitHub
51k
Vị trí xếp hạng
#3583
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự