Nixtla/nixtla

Public

TimeGPT-2.1: production ready pre-trained Time Series Foundation Model for forecasting and anomaly detection. Generative pretrained transformer for time series trained on over 100B data points. It's capable of accurately predicting various domains such as retail, electricity, finance, and IoT with just a few lines of code 🚀.

  • Stars4k+6 tuần này
  • Forks342
  • Watchers37
  • Issues45
  • Ngày tạo23/09/2021
  • Cập nhật gần nhất28/10/2026
  • Ngôn ngữJupyter Notebook
  • Giấy phép—
README.md26.3 KBRaw

Nixtla   Tweet  Slack

TimeGPT-2.1

Foundation model for forecasting and anomaly detection

CI PyPi License docs Downloads Downloads Downloads

TimeGPT is a production ready, generative pretrained transformer for time series. It's capable of accurately predicting various domains such as retail, electricity, finance, and IoT with just a few lines of code 🚀.

🚀 Quick Start

QuickstartTGPT.mp4

Install nixtla's SDK

pip install nixtla>=0.8.0

Import libraries and load data

import pandas as pd
from nixtla import NixtlaClient

Forecast using TimeGPT in 3 easy steps

# Obtain an API key via https://nixtla.io/free-trial

# 1. Instantiate the NixtlaClient
nixtla_client = NixtlaClient(api_key = 'YOUR API KEY HERE')

# 2. Read historic electricity demand data
df = pd.read_csv('https://raw.githubusercontent.com/Nixtla/transfer-learning-time-series/main/datasets/electricity-short.csv')

# 3. Forecast the next 24 hours
fcst_df = nixtla_client.forecast(df, h=24, level=[80, 90])

# 4. Plot your results (optional)
nixtla_client.plot(df, fcst_df, level=[80, 90])

Forecast Results

Anomaly detection using TimeGPT in 3 easy steps

Warning

detect_anomalies() performs historical (batch) detection and is removed in nixtla 1.0, where the name will refer to online anomaly detection instead. There is no drop-in replacement — use detect_anomalies_online(), which requires h and detection_size. See the CHANGELOG for details.

# Obtain an API key via https://nixtla.io/free-trial

# 1. Instantiate the NixtlaClient
nixtla_client = NixtlaClient(api_key = 'YOUR API KEY HERE')

# 2. Read Data # Wikipedia visits of NFL Star (
df = pd.read_csv('https://datasets-nixtla.s3.amazonaws.com/peyton-manning.csv')


# 3. Detect Anomalies
anomalies_df = nixtla_client.detect_anomalies(df, time_col='timestamp', target_col='value', freq='D')

# 4. Plot your results (optional)
nixtla_client.plot(df, anomalies_df,time_col='timestamp', target_col='value')

AnomalyDetection

🤓 API support for other languages

Explore our API Reference to discover how to leverage TimeGPT across various programming languages including JavaScript, Go, and more.

Nội dung README thuộc về Nixtla và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/Nixtla/nixtla