timesfm

使用谷歌 TimesFM 基础模型对时间序列数据进行零样本预测。适用于销售或需求预测、服务器指标预测、金融时间序列分析,以及无需训练自定义模型的异常检测场景。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
7

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "timesfm":https://skillpi.com/zh/skills/deepskill-4ca17e4d38bc1584e5e49915cc90282f3a277f832d032cd94df2e6422b1aa135。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用谷歌 TimesFM 基础模型对时间序列数据进行零样本预测。适用于销售或需求预测、服务器指标预测、金融时间序列分析,以及无需训练自定义模型的异常检测场景。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: timesfm
description: >-
  Forecast time series data using Google's TimesFM foundation model with zero-shot
  prediction. Use when: forecasting sales or demand, predicting server metrics,
  financial time series analysis, anomaly detection without training custom models.
license: Apache-2.0
compatibility: "Python 3.10+, PyTorch"
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: data-ai
  tags: ["forecasting", "time-series", "google-research"]

TimesFM

Overview

TimesFM is a 200M-parameter foundation model by Google Research, pretrained on 100 billion real-world time points. It performs zero-shot forecasting across domains — no fine-tuning required. Feed it historical data, get predictions immediately.

Instructions

Installation

pip install timesfm

Basic Forecasting

import timesfm
import numpy as np

# Initialize model
tfm = timesfm.TimesFm(
    hparams=timesfm.TimesFmHparams(
        per_core_batch_size=32,
        horizon_len=30,
    ),
    checkpoint=timesfm.TimesFmCheckpoint(
        huggingface_repo_id="google/timesfm-2.0-200m-pytorch",
    ),
)

# Your historical data (e.g., daily sales for 1 year)
history = np.array([120, 135, 128, 142, 155, 148, 160, ...])

# Forecast next 30 days
forecasts = tfm.forecast([history], freq=[1])
predictions = forecasts[0]  # shape: (30,)

Frequency Parameter

Set freq to match your data granularity:

  • 0: High frequency (seconds/minutes)
  • 1: Daily
  • 2: Weekly/Monthly

Multi-Series Forecasting

# Forecast multiple product categories at once
series = [sales_electronics, sales_clothing, sales_food]
forecasts = tfm.forecast(series, freq=[1, 1, 1])
# Returns list of 3 forecast arrays

Examples

Example 1: Demand forecasting

Input: 365 days of daily product sales data. Output: 30-day forecast with the model capturing weekly seasonality and growth trend automatically.

history = load_csv("daily_sales.csv")["quantity"].values
forecast = tfm.forecast([history], freq=[1])[0]
print(f"Next 7 days: {forecast[:7]}")
# Next 7 days: [182, 175, 190, 168, 195, 201, 178]

Example 2: Server metrics anomaly detection

Input: 720 hours (30 days) of CPU utilization. Output: Forecast next 24 hours. Flag if actual exceeds forecast by 2x standard deviation.

cpu_history = get_metrics("cpu_percent", days=30)
forecast = tfm.forecast([cpu_history], freq=[0])[0]
threshold = forecast.mean() + 2 * forecast.std()

Guidelines

  • Provide at least 3x the forecast horizon as history (forecasting 30 days? give 90+ days history)
  • TimesFM works best on data with clear patterns (seasonality, trends)
  • For noisy data, smooth with rolling average before feeding to the model
  • Compare against a naive baseline (last period's values) to validate improvement
  • The model runs on CPU; GPU speeds up batch processing of many series

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供基于 Google TimesFM 的时间序列零样本预测能力,适用于销售预测、服务器指标、金融分析等明确场景
  • 具备高实用价值,非测试性质或同质化壳工具,未违反安全底线
触发精准95/100

亮点

  • description 明确描述适用场景(销售/需求预测、服务器指标预测、金融时间序列分析、异常检测),覆盖多种变体,边界清晰
结构规范90/100

亮点

  • 文档结构清晰,包含 Overview、Instructions、Examples、Guidelines,frontmatter 完整,单文件未超500行
执行可靠88/100

亮点

  • 工具来源明确(Google Research 的 TimesFM),参数说明清晰,示例代码完整,覆盖主要异常,无不可逆操作
证据可验 (前四项均值)91/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 27 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。