Skip to main content

A unified framework for machine learning with time series

Project description

Welcome to sktime

A unified interface for machine learning with time series

:rocket: Version 0.39.0 out now! Check out the release notes here.

sktime is a library for time series analysis in Python. It provides a unified interface for multiple time series learning tasks. Currently, this includes forecasting, time series classification, clustering, anomaly/changepoint detection, and other tasks. It comes with time series algorithms and scikit-learn compatible tools to build, tune, and validate time series models.

Documentation · Tutorials · Release Notes
Open Source BSD 3-clause GC.OS Sponsored
Tutorials Binder !youtube
Community !discord !slack
CI/CD github-actions readthedocs platform
Code !pypi !conda !python-versions !black
Downloads PyPI - Downloads PyPI - Downloads Downloads
Citation !zenodo

:books: Documentation

Documentation
:star: Tutorials New to sktime? Here's everything you need to know!
:clipboard: Binder Notebooks Example notebooks to play with in your browser.
:woman_technologist: Examples How to use sktime and its features.
:scissors: Extension Templates How to build your own estimator using sktime's API.
:control_knobs: API Reference The detailed reference for sktime's API.
:tv: Video Tutorial Our video tutorial from 2021 PyData Global.
:hammer_and_wrench: Changelog Changes and version history.
:deciduous_tree: Roadmap sktime's software and community development plan.
:pencil: Related Software A list of related software.

:speech_balloon: Where to ask questions

Questions and feedback are extremely welcome! We strongly believe in the value of sharing help publicly, as it allows a wider audience to benefit from it.

Type Platforms
:bug: Bug Reports GitHub Issue Tracker
:sparkles: Feature Requests & Ideas GitHub Issue Tracker
:woman_technologist: Usage Questions GitHub Discussions · Stack Overflow
:speech_balloon: General Discussion GitHub Discussions
:factory: Contribution & Development dev-chat channel · Discord
:globe_with_meridians: Meet-ups and collaboration sessions Discord - Fridays 13 UTC, dev/meet-ups channel

:dizzy: Features

Our objective is to enhance the interoperability and usability of the time series analysis ecosystem in its entirety. sktime provides a unified interface for distinct but related time series learning tasks. It features dedicated time series algorithms and tools for composite model building, such as pipelining, ensembling, tuning, and reduction, empowering users to apply algorithms designed for one task to another.

sktime also provides interfaces to related libraries, for example scikit-learn, statsmodels, tsfresh, PyOD, and fbprophet, among others.

Module Status Links
Forecasting stable Tutorial · API Reference · Extension Template
Time Series Classification stable Tutorial · API Reference · Extension Template
Time Series Regression stable API Reference
Transformations stable Tutorial · API Reference · Extension Template
Detection tasks maturing Extension Template
Parameter fitting maturing API Reference · Extension Template
Time Series Clustering maturing API Reference · Extension Template
Time Series Distances/Kernels maturing Tutorial · API Reference · Extension Template
Time Series Alignment experimental API Reference · Extension Template
Time Series Splitters maturing Extension Template
Distributions and simulation experimental

:hourglass_flowing_sand: Install sktime

For troubleshooting and detailed installation instructions, see the documentation.

  • Operating system: macOS X · Linux · Windows 8.1 or higher
  • Python version: Python 3.10, 3.11, 3.12, and 3.13 (only 64-bit)
  • Package managers: pip · conda (via conda-forge)

pip

Using pip, sktime releases are available as source packages and binary wheels. Available wheels are listed here.

pip install sktime

or, with maximum dependencies,

pip install sktime[all_extras]

For curated sets of soft dependencies for specific learning tasks:

pip install sktime[forecasting]  # for selected forecasting dependencies
pip install sktime[forecasting,transformations]  # forecasters and transformers

or similar. Valid sets are:

  • forecasting
  • transformations
  • classification
  • regression
  • clustering
  • param_est
  • networks
  • detection
  • alignment

Cave: in general, not all soft dependencies for a learning task are installed, only a curated selection.

conda

You can also install sktime from conda via the conda-forge channel. The feedstock including the build recipe and configuration is maintained in this conda-forge repository.

conda install -c conda-forge sktime

or, with maximum dependencies,

conda install -c conda-forge sktime-all-extras

(as conda does not support dependency sets, flexible choice of soft dependencies is unavailable via conda)

:zap: Quickstart

Forecasting

from sktime.datasets import load_airline
from sktime.forecasting.base import ForecastingHorizon
from sktime.forecasting.theta import ThetaForecaster
from sktime.split import temporal_train_test_split
from sktime.performance_metrics.forecasting import mean_absolute_percentage_error

y = load_airline()
y_train, y_test = temporal_train_test_split(y)
fh = ForecastingHorizon(y_test.index, is_relative=False)
forecaster = ThetaForecaster(sp=12)  # monthly seasonal periodicity
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
mean_absolute_percentage_error(y_test, y_pred)
>>> 0.08661467738190656

Time Series Classification

from sktime.classification.interval_based import TimeSeriesForestClassifier
from sktime.datasets import load_arrow_head
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score

X, y = load_arrow_head()
X_train, X_test, y_train, y_test = train_test_split(X, y)
classifier = TimeSeriesForestClassifier()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
accuracy_score(y_test, y_pred)
>>> 0.8679245283018868

:wave: How to get involved

There are many ways to join the sktime community. We follow the all-contributors specification: all kinds of contributions are welcome - not just code.

Documentation
:gift_heart: Contribute How to contribute to sktime.
:school_satchel: Mentoring New to open source? Apply to our mentoring program!
:date: Meetings Join our discussions, tutorials, workshops, and sprints!
:woman_mechanic: Developer Guides How to further develop sktime's code base.
:construction: Enhancement Proposals Design a new feature for sktime.
:medal_sports: Contributors A list of all contributors.
:raising_hand: Roles An overview of our core community roles.
:money_with_wings: Donate Fund sktime maintenance and development.
:classical_building: Governance How and by whom decisions are made in sktime's community.

:trophy: Hall of fame

Thanks to all our community for all your wonderful contributions, PRs, issues, ideas.


:bulb: Project vision

  • By the community, for the community -- developed by a friendly and collaborative community.
  • The right tool for the right task -- helping users to diagnose their learning problem and suitable scientific model types.
  • Embedded in state-of-art ecosystems and provider of interoperable interfaces -- interoperable with scikit-learn, statsmodels, tsfresh, and other community favorites.
  • Rich model composition and reduction functionality -- build tuning and feature extraction pipelines, solve forecasting tasks with scikit-learn regressors.
  • Clean, descriptive specification syntax -- based on modern object-oriented design principles for data science.
  • Fair model assessment and benchmarking -- build your models, inspect your models, check your models, and avoid pitfalls.
  • Easily extensible -- easy extension templates to add your own algorithms compatible with sktime's API.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sktime-0.39.0.tar.gz (34.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sktime-0.39.0-py3-none-any.whl (35.6 MB view details)

Uploaded Python 3

File details

Details for the file sktime-0.39.0.tar.gz.

File metadata

  • Download URL: sktime-0.39.0.tar.gz
  • Upload date:
  • Size: 34.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sktime-0.39.0.tar.gz
Algorithm Hash digest
SHA256 1ab976faa55b2a118f93d15828d1a13be3d963f693fdd05fdf82f882405b9d13
MD5 0cffca4ea710d3e445e22df89f211f62
BLAKE2b-256 6eed362d06fa905cd85d6fb11ebd0dc98c28495f31f081c78c3497f3df10b313

See more details on using hashes here.

Provenance

The following attestation bundles were made for sktime-0.39.0.tar.gz:

Publisher: wheels.yml on sktime/sktime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sktime-0.39.0-py3-none-any.whl.

File metadata

  • Download URL: sktime-0.39.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sktime-0.39.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4fa722866336d7f43f82c9239cd2c9d3a89aab553aa5c59ce4bfbc212d4d56bd
MD5 95c28f1c14f8bdd77b8c40be83c4b2ee
BLAKE2b-256 55207c8c6d63d400336a63e56b1f57b37690ce2e14f91245cf3c196ef0cfe1cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for sktime-0.39.0-py3-none-any.whl:

Publisher: wheels.yml on sktime/sktime

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page