GitHub repo xịn · Vui Coding chọn
google-research/timesfm
Repository phát triển mô hình TimesFM của Google Research để dự báo chuỗi thời gian, giúp phân tích và dự đoán dữ liệu chuỗi hiệu quả hơn. Model hỗ trợ dự báo đa biến, có khả năng xử lý các covariates linh hoạt, đạt thành tích hàng đầu trong các benchmark.
Tóm tắt nhanh
Repo này làm được gì?
Repository phát triển mô hình TimesFM của Google Research để dự báo chuỗi thời gian, giúp phân tích và dự đoán dữ liệu chuỗi hiệu quả hơn. Model hỗ trợ dự báo đa biến, có khả năng xử lý các covariates linh hoạt, đạt thành tích hàng đầu trong các benchmark.
Mô tả từ GitHub
TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
Bắt đầu với repo
Cài đặt và sử dụng
Hướng dẫn cài đặt
Bước 1: Clone repo:
git clone https://github.com/google-research/timesfm.git
cd timesfmBước 2: Tạo môi trường ảo:
uv venv
source .venv/bin/activateBước 3: Cài đặt package:
uv pip install -e .[torch]Hướng dẫn sử dụng
Bước 1: Khởi tạo cấu hình:
from timesfm3 import TimesFM3Evaluator, ModelConfig
config = ModelConfig(
checkpoint_path="google/timesfm-3.0-pytorch",
per_core_batch_size=32,
device="cuda"
)
forecaster = TimesFM3Evaluator(config)Bước 2: Dự báo chuỗi đơn biến:
outputs = list(forecaster.predict_batch([ts1, ts2], horizon=12, return_quantiles=True))Bước 3: Dự báo đa biến với covariates:
outputs = list(forecaster.predict_batch(
contexts=[target],
horizon=24,
past_only_covariates=[past_only_cov],
past_future_covariates=[past_future_cov],
return_quantiles=True
))