Welcome to PyPOTS docs!

README translations English | 简体中文 | 日本語 | 한국어 | Deutsch | Français | Español | Português (Brasil) | Русский | Bahasa Indonesia

PyPOTS logo

A Python Toolbox for Unified Analysis of Real-World Time Series

Python version the latest release version Docs building PyPI downloads Conda downloads Pytorch landscape BSD-3 license Community GitHub Repo stars GitHub Repo forks GitHub contributors GitHub Testing Coveralls coverage maintainability Code Style Code of Conduct Ask DeepWiki arXiv DOI

PyPOTS (pronounced “Pie Pots”) is an open-source Python toolbox for time series analysis, offering 50+ models and methods with unified APIs for imputation, forecasting, classification, clustering, anomaly detection, and representation learning. It is designed for real-world time series, including those with missing values.

A time series is not the underlying system itself, but a collection of observations of that system. Due to the inherent limitations of measurement and sampling, real-world time series are fundamentally partial observations: measured variables capture only certain aspects of the underlying system, observations are collected at discrete and potentially irregular intervals, and some measurements may be missing.

Being unobserved does not necessarily mean being nonexistent. Partial observation is the norm, not the exception.

We conceptualize real-world time series as Partially-Observed Time Series (POTS). From this perspective, time series modeling is fundamentally about learning the underlying system and its dynamics from partial observations. PyPOTS is built upon this philosophy to enable unified time series analysis for real-world data.

❖ Key Features

  • Multi-task support: Imputation, forecasting, classification, clustering, anomaly detection, and representation learning in one toolbox.

  • Native missing-value support: Missingness-aware models can learn directly from incomplete time series without prior imputation.

  • Unified APIs: Consistent training and prediction interfaces across models, making experimentation and model comparison easier.

  • Rich model zoo: 50+ models and methods spanning classical approaches, deep learning, LLM-based models, and time series foundation models (TSFMs).

  • PyTorch Ecosystem: PyPOTS is built on PyTorch and featured in the PyTorch Landscape.

  • Hardware acceleration: CPU, NVIDIA CUDA GPUs, and Ascend NPUs; multi-device training via PyTorch DistributedDataParallel (DDP), CUDA DataParallel, and automatic mixed precision for supported models. See the acceleration guide for setup and limitations.

  • Flexible data handling: In-memory data and lazy loading from HDF5 files.

  • Hyperparameter optimization: Model tuning powered by Optuna.

  • Reproducible research: Datasets, missingness simulation, standardized preprocessing, and evaluation tools across the PyPOTS ecosystem.

  • Extensible architecture: Modular model components and standardized templates for integrating new algorithms.

❖ Installation

PyPOTS requires Python 3.10 or later and is available on PyPI and Anaconda.

pip install pypots

See Installation for pip, Conda, Docker and source installation, dependency requirements, and hardware acceleration. See NPU Support (Ascend) and Distributed Training (DDP) for Ascend NPU and distributed training.

❖ Usage

This self-contained SAITS imputation example uses synthetic data and requires no dataset download. Inputs have shape (n_samples, n_steps, n_features), with missing values represented by NaN.

import numpy as np
from pypots.imputation import SAITS

# Generate synthetic time series with missing values
rng = np.random.default_rng(42)
X = rng.normal(size=(16, 24, 8)).astype(np.float32)
X[rng.random(X.shape) < 0.1] = np.nan
train_X, test_X = X[:12], X[12:]

# Initialize a SAITS imputation model
model = SAITS(
    n_steps=24, n_features=8,
    n_layers=2, d_model=64, n_heads=4,
    d_k=16, d_v=16, d_ffn=128,
    epochs=2, device="cpu",
)
# Train the model
model.fit({"X": train_X})

# Impute the test set
imputed_X = model.impute({"X": test_X})
print(imputed_X.shape)  # (4, 24, 8)

Explore PyPOTS by Task

Task

What it does

Resources

Imputation

Estimate missing observations

Examples · API

Forecasting

Predict future values

Examples · API

Classification

Assign labels to time series

Examples · API

Clustering

Discover groups of similar time series

Examples · API

Anomaly detection

Identify abnormal observations or patterns

Examples · API

Representation learning

Learn latent representations of time series

Examples · API

See Quick-Start Tutorials for the PhysioNet2012 example, BrewPOTS notebooks, Google Colab and the KDD 2026 hands-on tutorial.

❖ Model Zoo

The table below lists the models and methods implemented in PyPOTS, sorted by publication year, alongside the Time-Series.AI waitlist entry. Each linked ✅ leads to a standalone, task-specific Python example. An empty cell indicates that the corresponding implementation is not currently available in PyPOTS.

Models marked with 🧑‍🔧 were adapted to handle explicit missing values. Depending on the task, these adaptations use missingness-aware embeddings and training strategies, including observed reconstruction and masked imputation (ORT + MIT) for imputation, as introduced in SAITS [1]. Input formats and support for irregular sampling depend on the individual model.

Task abbreviations: IMPT (Imputation), FCST (Forecasting), CLAF (Classification), CLUS (Clustering), ANOD (Anomaly Detection), and REPR (Representation Learning). Paper references appear in References.

Type

Model

IMPT

FCST

CLAF

CLUS

ANOD

REPR

Publication

LLM&TSFM

Time-Series.AI logo Time-Series.AI

✅

✅

✅

✅

✅

✅

Join waitlist

Neural Net

HELIX [2]

✅

2026 - ICML

Neural Net

MixLinear🧑‍🔧 [3]

✅

2026 - ICLR

Neural Net

SegRNN🧑‍🔧 [4]

✅

✅

✅

2026 - IoT-J

TSFM

TS-ICL [5]

✅

✅

2026 - arXiv

Neural Net

LIFTS [6]

✅

✅

2026 - arXiv

Neural Net

TEFN🧑‍🔧 [7]

✅

✅

✅

✅

2025 - TPAMI

Neural Net

TimeMixer++ [8]

✅

✅

✅

2025 - ICLR

LLM

Time-LLM🧑‍🔧 [9]

✅

✅

2024 - ICLR

TSFM

MOMENT [10]

✅

✅

2024 - ICML

Neural Net

TSLANet [11]

✅

2024 - ICML

Neural Net

FITS🧑‍🔧 [12]

✅

✅

2024 - ICLR

Neural Net

TimeMixer [8]

✅

✅

✅

2024 - ICLR

Neural Net

iTransformer🧑‍🔧 [13]

✅

✅

✅

2024 - ICLR

Neural Net

ModernTCN [14]

✅

✅

2024 - ICLR

Neural Net

ImputeFormer🧑‍🔧 [15]

✅

✅

2024 - KDD

Neural Net

TOTEM [16]

✅

2024 - TMLR

Neural Net

TKAN🧑‍🔧 [17]

✅

2024 - arXiv

Neural Net

SAITS [1]

✅

✅

✅

2023 - ESWA

LLM

GPT4TS [18]

✅

✅

2023 - NeurIPS

Neural Net

FreTS🧑‍🔧 [19]

✅

2023 - NeurIPS

Neural Net

Koopa🧑‍🔧 [20]

✅

2023 - NeurIPS

Neural Net

Crossformer🧑‍🔧 [21]

✅

✅

2023 - ICLR

Neural Net

TimesNet [22]

✅

✅

✅

✅

2023 - ICLR

Neural Net

PatchTST🧑‍🔧 [23]

✅

✅

✅

2023 - ICLR

Neural Net

ETSformer🧑‍🔧 [24]

✅

✅

2023 - ICLR

Neural Net

MICN🧑‍🔧 [25]

✅

✅

2023 - ICLR

Neural Net

DLinear🧑‍🔧 [26]

✅

✅

✅

2023 - AAAI

Neural Net

TiDE🧑‍🔧 [27]

✅

2023 - TMLR

Neural Net

CSAI [28]

✅

✅

2023 - arXiv

Neural Net

TS2Vec [29]

✅

✅

2022 - AAAI

Neural Net

SCINet🧑‍🔧 [30]

✅

✅

2022 - NeurIPS

Neural Net

Non-stationary Transformer🧑‍🔧 [31]

✅

✅

2022 - NeurIPS

Neural Net

FiLM🧑‍🔧 [32]

✅

✅

✅

2022 - NeurIPS

Neural Net

RevIN_SCINet🧑‍🔧 [33]

✅

2022 - ICLR

Neural Net

Pyraformer🧑‍🔧 [34]

✅

✅

2022 - ICLR

Neural Net

Raindrop [35]

✅

2022 - ICLR

Neural Net

FEDformer🧑‍🔧 [36]

✅

✅

2022 - ICML

Neural Net

Autoformer🧑‍🔧 [37]

✅

✅

✅

2021 - NeurIPS

Neural Net

CSDI [38]

✅

✅

2021 - NeurIPS

Neural Net

Informer🧑‍🔧 [39]

✅

✅

2021 - AAAI

Neural Net

US-GAN [40]

✅

2021 - AAAI

Neural Net

CRLI [41]

✅

2021 - AAAI

Probabilistic

BTTF [42]

✅

2021 - TPAMI

Neural Net

StemGNN🧑‍🔧 [43]

✅

2020 - NeurIPS

Neural Net

SeFT [44]

✅

2020 - ICML

Neural Net

Reformer🧑‍🔧 [45]

✅

✅

2020 - ICLR

Neural Net

GP-VAE [46]

✅

2020 - AISTATS

Neural Net

VaDER [47]

✅

2019 - GigaSci.

Neural Net

M-RNN [48]

✅

2019 - TBME

Neural Net

BRITS [49]

✅

✅

2018 - NeurIPS

Neural Net

GRU-D [50]

✅

✅

2018 - Sci. Rep.

Neural Net

TCN🧑‍🔧 [51]

✅

2018 - arXiv

Neural Net

Transformer🧑‍🔧 [52]

✅

✅

✅

2017 - NeurIPS

MF

TRMF [53]

✅

2016 - NeurIPS

Naive

Lerp

✅

Naive

LOCF/NOCB

✅

Naive

Mean

✅

Naive

Median

✅

Time-Series.AI is building next-generation AI solutions for unified time series analysis, powered by foundation models and AI agents. Join our waitlist for early access.

Model types: LLM-based models build on language models pretrained on text, whereas TSFMs build on models pretrained on time series data. These categories describe the underlying modeling approach.

Want to add a model? See the contribution guide to make your research more accessible, reproducible, and discoverable by the time series community.

❖ PyPOTS Ecosystem

Welcome to the PyPOTS coffee universe! Our ecosystem takes inspiration from brewing coffee, with each library playing a distinct role in the time series analysis pipeline.

TSDB logo

👈 Time series datasets are our coffee beans, and POTS datasets are beans with missing parts. Time Series Data Beans (TSDB) makes public time series datasets easy to load. Visit its repository for the latest list of supported datasets.

PyGrinder logo

👉 PyGrinder grinds your coffee beans into incomplete ones by simulating missing values. It supports all three missingness mechanisms defined by Rubin [54], namely MCAR (missing completely at random), MAR (missing at random), and MNAR (missing not at random). Introduce synthetic missing values in a single line of code.

BenchPOTS logo

👈 Take a seat on the bench! BenchPOTS provides standardized data preprocessing pipelines for fair and reproducible evaluation of time series algorithms across tasks.

BrewPOTS logo

👉 Ready to brew? BrewPOTS brings together tutorials and notebooks to help you learn how to brew your POTS datasets with PyPOTS.

PyPOTS ecosystem pipeline

☕️ Welcome to the universe of PyPOTS. Enjoy it and have fun!

❖ Citing PyPOTS

PyPOTS was first introduced at the MiLeTS workshop at KDD 2023. If you use PyPOTS in your research, please cite the toolkit paper.

@article{du2023pypots,
title = {{PyPOTS: A Python Toolkit for Data Mining on Partially-Observed Time Series}},
author = {Wenjie Du},
journal = {SIGKDD MiLeTS Workshop},
url = {https://arxiv.org/abs/2305.18811v1},
year = {2023},
}
@article{du2025pypots,
title = {{PyPOTS: A Python Toolkit for Machine Learning on Partially-Observed Time Series}},
author = {Wenjie Du and Yiyuan Yang and Linglong Qian and Jun Wang and Qingsong Wen},
journal = {arXiv preprint arXiv:2305.18811v2},
url = {https://arxiv.org/abs/2305.18811v2},
year = {2025},
}

There are scientific research projects using PyPOTS and referencing it in their papers. Explore research citing or using PyPOTS here.

❖ Contribution

We welcome contributions from researchers, engineers, and users:

  • New models: Review our inclusion criteria and use a task-specific template (e.g., imputation).

  • Bug fixes and features: Report reproducible issues or propose improvements through GitHub Issues.

  • Documentation and examples: Improve tutorials, API documentation, usage examples, and translations.

  • Testing: Add regression tests and help improve the reliability and reproducibility of PyPOTS.

  • Security: Report vulnerabilities privately as described in SECURITY.md.

Before submitting a pull request, we recommend enabling pre-commit in your local clone to automatically format and check your changes:

pip install pre-commit
pre-commit install

The hooks run automatically when you commit. If a hook modifies files, review and stage the changes, then commit again. GitHub CI checks Ruff linting and formatting even if you do not install the hooks. See the developer guide for details.

Contributors are recognized on the GitHub contributors page, the PyPOTS website, and in release notes where applicable. Please follow our Code of Conduct.

If you find PyPOTS useful, consider starring the repository to help others discover it. Explore the affiliations of our users.

❖ Community

Join the PyPOTS community to ask questions, discuss research, share feedback, and collaborate:

  • Discord: General discussion, Q&A, and development.

  • Slack (retired): We have moved to Discord because Slack’s free plan does not retain conversation history indefinitely.

  • LinkedIn: Official announcements and news.

  • WeChat (微信公众号): Follow the official account to access the community group QR code.

  • GitHub Issues: Bug reports and feature requests.

We welcome feedback and ideas from everyone working on real-world time series.