Skip to main content

scikit-learn compatible Python toolbox for machine learning with time series

Project description

travis appveyor azure codecov readthedocs pypi gitter binder zenodo twitter

sktime

sktime is a Python machine learning toolbox for time series with a unified interface for multiple learning tasks. We currently support:

  • Forecasting,

  • Time series classification,

  • Time series regression.

sktime provides dedicated time series algorithms and scikit-learn compatible tools for building, tuning, and evaluating composite models.

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


Installation

The package is available via PyPI using:

pip install sktime

The package is actively being developed and some features may not be stable yet.

Development Version

To install the development version, please see our advanced installation instructions.


Quickstart

Forecasting

import numpy as np
from sktime.datasets import load_airline
from sktime.forecasting.theta import ThetaForecaster
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.performance_metrics.forecasting import smape_loss

y = load_airline()
y_train, y_test = temporal_train_test_split(y)
fh = np.arange(1, len(y_test) + 1)  # forecasting horizon
forecaster = ThetaForecaster(sp=12)  # monthly seasonal periodicity
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
smape_loss(y_test, y_pred)
>>> 0.1722386848882188

For more, check out the forecasting tutorial.

Time Series Classification

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

X, y = load_arrow_head(return_X_y=True)
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.7924528301886793

For more, check out the time series classification tutorial.


Documentation


API Overview

sktime is a unified toolbox for machine learning with time series. Time series give rise to multiple learning tasks (e.g. forecasting and time series classification). The goal of sktime is to provide all the necessary tools to solve these tasks, including dedicated time series algorithms as well as tools for building, tuning and evaluating composite models.

Many of these tasks are related. An algorithm that can solve one of them can often be re-used to help solve another one, an idea called reduction. sktime’s unified interface allows to easily adapt an algorithm for one task to another.

For example, to use a regression algorithm to solve a forecasting task, we can simply write:

import numpy as np
from sktime.datasets import load_airline
from sktime.forecasting.compose import ReducedRegressionForecaster
from sklearn.ensemble import RandomForestRegressor
from sktime.forecasting.model_selection import temporal_train_test_split
from sktime.performance_metrics.forecasting import smape_loss

y = load_airline()
y_train, y_test = temporal_train_test_split(y)
fh = np.arange(1, len(y_test) + 1)  # forecasting horizon
regressor = RandomForestRegressor()
forecaster = ReducedRegressionForecaster(regressor, window_length=12)
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
smape_loss(y_test, y_pred)
>>> 0.12726230426056875

For more details, check out our paper.

Currently, sktime provides:

  • State-of-the-art algorithms for time series classification and regression, ported from the Java-based tsml toolkit, as well as forecasting,

  • Transformers, including single-series transformations (e.g. detrending or deseasonalization) and series-as-features transformations (e.g. feature extractors), as well as tools to compose different transformers,

  • Pipelining,

  • Tuning,

  • Ensembling, such as a fully customisable random forest for time-series classification and regression, as well as ensembling for multivariate problems,

For a list of implemented methods, see our estimator overview.

In addition, sktime includes an experimental high-level API that unifies multiple learning tasks, partially inspired by the APIs of mlr and openML.


Development Roadmap

sktime is under active development. We’re looking for new contributors, all contributions are welcome!

  1. Multivariate/panel forecasting based on a modified pysf API,

  2. Unsupervised learning, including time series clustering,

  3. Time series annotation, including segmentation and outlier detection,

  4. Specialised data container for efficient handling of time series/panel data in a modelling workflow and separation of time series meta-data,

  5. Probabilistic modelling framework for time series, including survival and point process models based on an adapted skpro interface.

For more details, read this issue.


How to contribute

For former and current contributors, see our overview.


How to cite sktime

If you use sktime in a scientific publication, we would appreciate citations to the following paper:

Markus Löning, Anthony Bagnall, Sajaysurya Ganesh, Viktor Kazakov, Jason Lines, Franz Király (2019): “sktime: A Unified Interface for Machine Learning with Time Series”

Bibtex entry:

@inproceedings{sktime,
    author = {L{\"{o}}ning, Markus and Bagnall, Anthony and Ganesh, Sajaysurya and Kazakov, Viktor and Lines, Jason and Kir{\'{a}}ly, Franz J},
    booktitle = {Workshop on Systems for ML at NeurIPS 2019},
    title = {{sktime: A Unified Interface for Machine Learning with Time Series}},
    date = {2019},
}

Project details


Release history Release notifications | RSS feed

This version

0.4.2

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.4.2.tar.gz (9.7 MB view details)

Uploaded Source

Built Distributions

sktime-0.4.2-cp38-cp38-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.8 Windows x86-64

sktime-0.4.2-cp38-cp38-manylinux2014_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.8

sktime-0.4.2-cp38-cp38-manylinux2010_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

sktime-0.4.2-cp38-cp38-manylinux1_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.8

sktime-0.4.2-cp38-cp38-macosx_10_13_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.8 macOS 10.13+ x86-64

sktime-0.4.2-cp37-cp37m-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.7m Windows x86-64

sktime-0.4.2-cp37-cp37m-manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.7m

sktime-0.4.2-cp37-cp37m-manylinux2010_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

sktime-0.4.2-cp37-cp37m-manylinux1_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.7m

sktime-0.4.2-cp37-cp37m-macosx_10_13_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

sktime-0.4.2-cp36-cp36m-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.6m Windows x86-64

sktime-0.4.2-cp36-cp36m-manylinux2014_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.6m

sktime-0.4.2-cp36-cp36m-manylinux2010_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

sktime-0.4.2-cp36-cp36m-manylinux1_x86_64.whl (5.2 MB view details)

Uploaded CPython 3.6m

sktime-0.4.2-cp36-cp36m-macosx_10_13_x86_64.whl (4.3 MB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: sktime-0.4.2.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for sktime-0.4.2.tar.gz
Algorithm Hash digest
SHA256 2874263359650b7c9bfb1d27e66194ca09c5b97d9c64d43e140ffc38de6646aa
MD5 7cbe981f9812b07ec379294cd5aac6f5
BLAKE2b-256 945d60fa029758af24f826469851c54c44e69e84b2902b7e15e7d9857884af91

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c2fa5b078a3f1b2eccb6f97d25047b377999cd58a2f2f7c5d4575f515e2be1ec
MD5 56dd3deca6bc2dbdac99df1e2817534d
BLAKE2b-256 35a699032cf827c6ce999a2c6e867b3a0adbef1ae601c42eb5883dca95fdb34d

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.7 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 195da4a89b69cbb21f5abd928e5c7961312a3e7b12402ee4a04f83e612d3a61e
MD5 b5e07483285e4a263f1ec64cbccbef80
BLAKE2b-256 5f2789691a8e52341f8d5608800bc5180c89eee451aa3fe253b5f2c440c8425d

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 cadf5c93a3a895ec0e83b307ac70b561e5a4f4cc5e928e26614b0ef62a3dd0cb
MD5 ef6778d296a8e0d215bf4fe5b15aa631
BLAKE2b-256 5732afb18393b54ec4e255478ca4f68b6c218fad77f05db7c71f05cc0edc2d9e

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp38-cp38-manylinux1_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e50bec96d4450b93a3529d0cea308bd4023838b6297393d56edbac5df43be45
MD5 304e8c97c882156a7e6a3800f2c78736
BLAKE2b-256 f12e683f21ba2fff5d0b0349afbc01ced5f967d7c35701ef59a0deb7ce9d9dea

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp38-cp38-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp38-cp38-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.8, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 3ec2d4740070f5fa65ad8641efc3487fc0c5a49aee695c7c1792574fa943e067
MD5 493f7a7f1830474759cccf9097933d68
BLAKE2b-256 9d7eacd4c2d64a93fd10d519a307a56743f557b3931e85f3a2b7ff8697eae501

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for sktime-0.4.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e41b77a1170aba90da0ffa863097e1c5d64b0be0a3a1cb22542a1cdd3ad99ec8
MD5 75b30a5caa39f0fc38dd5b5bad25dc74
BLAKE2b-256 8098641fb123fae30c0b98c37563dc4c3722f705ae6c13d759dbca3a1179a8cc

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6f999ad8260e22a7469f166e9ad6fe975f2857b0e4c32f776f46501133360d43
MD5 8fc3dfb32b149dfd3320ed26939b84bf
BLAKE2b-256 07a88c7ad6f11ae0dbfe008e40476db44d5b40371bb76d191fe7dc1105fd783a

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d381b2c0c30b0cb9088e96f6b5f98a8502cca45403d7542b00c9727f923c2f0a
MD5 325244e07d40477f54482dfce39e39f0
BLAKE2b-256 d553e976707f72ed14c1ba0e01cca34f7697c20409a3044bc1379c01bd659076

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 189e2e71a8642b4e07b32c6ae3a39a092313101da14377c42252ae7239c38122
MD5 ac0c0520218cf173b9bc0f62e79eedc7
BLAKE2b-256 7a2c53c28211a995f68aba91fca7c6fa0ac1862195ec8043fe816cb3de165a58

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp37-cp37m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.7m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.9

File hashes

Hashes for sktime-0.4.2-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 2cdc39745f97776461c6847aca56882682f03f51477adc80a50fc72a9c162382
MD5 9ccfe87440abb034f447a069699ccd29
BLAKE2b-256 c3ec375708c0c3a2491061ec28f9af1527ede867d4963b4e1ca2c5663eac5139

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 4.2 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0.post20200925 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.12

File hashes

Hashes for sktime-0.4.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 35fe80be73b06ff2f8b44039a35da83da2d6eb6c2f83e86e9b3ae21652f91148
MD5 0887c416bb1e960dabe550c024031329
BLAKE2b-256 171257bf55960829696a9c12a67d8263582027afc5ecd339abd6be56914f9087

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 985891c5e630f280550d386a7450e9ea4895b873d4a5c07791defec980e39879
MD5 1dd294a500a2a35b85ad7bf94c104e55
BLAKE2b-256 1b7111d8e92ba4576fefd010168f4aab62a3baa6e5aa2ab3ac081c7fb5913075

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4a1bb29c0b1dfa32fe5770460164ba32d6ebbf7f3ea18f6152eea1704f3d8bb6
MD5 653ea365a3ea35e784f64329c8e8617d
BLAKE2b-256 9105165d152065861d1f6b120849852603500c2709d44bc68e88e63a84b0501a

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.2 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for sktime-0.4.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 c20b592037fc59778f96bf6137e037adf0cfe4419f7b109e5f145ef5b85a7238
MD5 67e747f2978bb42aea914addb03a62a2
BLAKE2b-256 ad112bf982f14bdc68d5471e639090d611891035a90f5d52d1acd7ae25f7d8e6

See more details on using hashes here.

File details

Details for the file sktime-0.4.2-cp36-cp36m-macosx_10_13_x86_64.whl.

File metadata

  • Download URL: sktime-0.4.2-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.6m, macOS 10.13+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.12

File hashes

Hashes for sktime-0.4.2-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 05207c1c27d9a035bb7b3e0d25ca4314c4359eb86205449bf714aa4676ccfe43
MD5 20de6a69f5d5a905fb6b9c9e84cd3e4d
BLAKE2b-256 a936e7320126ecbcfa64a10bcd9bd3e5a0c04143ce15c65992d6c4cca2b79960

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