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.20.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 time series classification, regression, clustering, annotation and forecasting. It comes with time series algorithms and scikit-learn compatible tools to build, tune and validate time series models.

Overview
CI/CD github-actions !codecov readthedocs platform
Code !pypi !conda !python-versions !black Binder
Downloads Downloads Downloads Downloads
Community !discord !slack !youtube
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: User Guides 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! Please understand that we won't be able to provide individual support via email. We also believe that help is much more valuable if it's shared publicly, so that more people can 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 contributors channel · Discord
:globe_with_meridians: Community collaboration session Discord - Fridays 3pm UTC, dev/meet-ups channel

:dizzy: Features

Our aim is to make the time series analysis ecosystem more interoperable and usable as a whole. 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 including pipelining, ensembling, tuning and reduction that enables users to apply an algorithm for one task to another.

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

For deep learning, see our companion package: sktime-dl.

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
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
Annotation experimental Extension Template
Distributions and simulation experimental

:hourglass_flowing_sand: Install sktime

For trouble shooting and detailed installation instructions, see the documentation.

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

pip

Using pip, sktime releases are available as source packages and binary wheels. You can see all available wheels here.

pip install sktime

or, with maximum dependencies,

pip install sktime[all_extras]

conda

You can also install sktime from conda via the conda-forge channel. For the feedstock including the build recipe and configuration, check out this repository.

conda install -c conda-forge sktime

or, with maximum dependencies,

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

:zap: Quickstart

Forecasting

from sktime.datasets import load_airline
from sktime.forecasting.base import ForecastingHorizon
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.forecasting.theta import ThetaForecaster
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.

: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 favourites.
  • 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, 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.20.0.tar.gz (16.4 MB view details)

Uploaded Source

Built Distribution

sktime-0.20.0-py3-none-any.whl (17.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sktime-0.20.0.tar.gz
  • Upload date:
  • Size: 16.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for sktime-0.20.0.tar.gz
Algorithm Hash digest
SHA256 9a5ce7e2e885721b15f9920f76cede0182bf16c546b2fef1120d7008be789dc9
MD5 2924818736cff6da5fe3ab50447272a6
BLAKE2b-256 7d4205c1f0ba48cb39e280050a16e6464f031ae613c2a8284076e274d653ddfc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.20.0-py3-none-any.whl
  • Upload date:
  • Size: 17.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.4

File hashes

Hashes for sktime-0.20.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8cf64ac16b100d6af689df1d27b279d3c778e97ce8d9e4d6b70c6ae4bb94f1c9
MD5 cec7bce615bda12110a74b3aafd103b9
BLAKE2b-256 0e306142c17860eba2f7a8d67d820285f2b9ab959a70feeaa710490b916cd5a9

See more details on using hashes here.

Supported by

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