█

AI/TLDR

Buy me a coffee
Buy me a coffee

sktime

Unified scikit-learn-style toolkit for time series ML

Biosignals & Time-Series MLOpen source
Language
Python
$pip install sktime
IN SHORT

What is sktime?

sktime is a Python library for machine learning with time series. It sits in the Biosignals & Time-Series ML category of the Science & Biomedical AI tools and is open-source, written in Python. To get started: install sktime.

Overview

sktime is a Python library for machine learning with time series. It offers a single, unified interface across several time series learning tasks, so the same fit and predict pattern works whether you are forecasting a signal, classifying it, or transforming it.

The framework follows scikit-learn interface conventions and interoperates with scikit-learn, statsmodels, tsfresh, and PyOD. It builds on pandas and NumPy data structures and runs in memory on a single machine, which keeps it approachable for people who already know the scientific Python stack.

Because it treats a time series as the core data type, sktime is a practical base for physiological and biosignal work, where recordings such as heart-rate or EEG traces need to be classified, forecast, or turned into features before further analysis.

What it does

  • Unified scikit-learn-style interface across multiple time series tasks
  • Forecasting, classification, regression, and transformations as stable modules
  • Clustering, anomaly and changepoint detection, and distances or kernels as maturing modules
  • Composite model building with pipelines, ensembling, and tuning
  • Interfaces to scikit-learn, statsmodels, tsfresh, and PyOD
  • Extension templates for adding custom algorithms

Getting started

Install sktime with pip, then load a series and fit a forecaster using the scikit-learn-style API.

Install sktime

Install the core package from PyPI. To pull in optional dependencies for all modules, install the all_extras variant instead.

bashbash
pip install sktime

Install with all dependencies (optional)

Some modules rely on extra libraries. This variant installs sktime together with those optional dependencies.

bashbash
pip install sktime[all_extras]

Fit a forecaster

Load a sample series, split it into train and test periods, then fit a forecaster and predict over the test index using the familiar fit and predict pattern.

pythonpython
from sktime.datasets import load_airline
from sktime.forecasting.theta import ThetaForecaster
from sktime.split import temporal_train_test_split

y = load_airline()
y_train, y_test = temporal_train_test_split(y)
forecaster = ThetaForecaster(sp=12)
forecaster.fit(y_train)
y_pred = forecaster.predict(y_test.index)

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Forecast future values of a time series, such as demand, sensor, or vital-sign readings
  • Classify physiological and biosignal recordings like ECG or EEG traces into categories
  • Turn raw time series into features with transformations before feeding them to a model
  • Build and tune composite pipelines that combine transformations, models, and validation

How sktime compares

sktime alongside other open-source biosignals & time-series ml tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
sktime★ 10.1kUnified scikit-learn-style toolkit for time series ML
Darts★ 9.6kPython library for user-friendly time-series forecasting and anomaly detection, from classical models to deep learning.
tsai★ 6.2kDeep-learning library for time series and sequences, built on PyTorch and fastai.
MNE-Python★ 3.6kOpen-source Python package for exploring, analyzing, and modeling MEG, EEG, and other neurophysiological time-series data.
NeuroKit2★ 2.4kPython toolbox for neurophysiological signal processing — ECG, EEG, EDA, and PPG — for building digital-biomarker pipelines.