Skip to main content

A unified 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

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

Uploaded Source

Built Distributions

sktime-0.4.3-cp38-cp38-win_amd64.whl (4.3 MB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

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

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.8

sktime-0.4.3-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.3-cp37-cp37m-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.7m Windows x86-64

sktime-0.4.3-cp37-cp37m-manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.7m

sktime-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl (5.5 MB view details)

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

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

Uploaded CPython 3.7m

sktime-0.4.3-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.3-cp36-cp36m-win_amd64.whl (4.2 MB view details)

Uploaded CPython 3.6m Windows x86-64

sktime-0.4.3-cp36-cp36m-manylinux2014_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.6m

sktime-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl (5.5 MB view details)

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

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

Uploaded CPython 3.6m

sktime-0.4.3-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.3.tar.gz.

File metadata

  • Download URL: sktime-0.4.3.tar.gz
  • Upload date:
  • Size: 9.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

File hashes

Hashes for sktime-0.4.3.tar.gz
Algorithm Hash digest
SHA256 109b2cec82ebb2891256562ec16e10d7a1e285c597b65f1dfc03da44160956f1
MD5 66c7bb9a888a0cc66ece93fb672a02e9
BLAKE2b-256 84400e770a79f19c3b00b546afc2a1fa3817c386ffcfc58ff62bc59a023f5043

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 4.3 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for sktime-0.4.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 bee61b48acabfa59ddc71c3952da51e303fbb5ef0d7502c5866550fbc85427c6
MD5 f912dce5e3b6f4ecf55de80ccb05a31b
BLAKE2b-256 88ac30b11bff6bbe75beeb2f35786dbd77d6ff84bb18415a2f9fd81cfc14264d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8cc750b165cc25e3ac438d254fad9509c4ceeadb4e270dca24923b6a31c1707e
MD5 00ffaa25fdaf8ba71a64ee44e366f66e
BLAKE2b-256 46520b3169df49a3e79f94d0905c89fb29757cb6a7fd005be0894bb7d6a0a202

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7ec8ff211bdc2e2e25a550267ee13747d7eb046684a98effe6f2d736d8e325ee
MD5 ce6d13eaaa42337bb01a769d1f5e5efa
BLAKE2b-256 29d14f88ce265c0892f11157ac0e84003e6c565c5c1dc9e9da3f1ee3f50ac98e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 30352d6a67276425ea0fd87cda9c5f5436dd80617fbb3449213640cade8ce433
MD5 bb9c9dc810d04abc8cb61185d971fde1
BLAKE2b-256 e0c3a0f286d6d836b98cc6fc68de7bdbb918390026cdfdd3bb5714d4c1f93e6f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for sktime-0.4.3-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 73c21abe2ebfd471c655a3559322d962bf5bc6cf295e8455e4d4517b3f5b3253
MD5 d1bf46949ace51325a8f7eb331be8945
BLAKE2b-256 4a70be39acc527a1a0cda9f972bbf8acc4eb26677637093ec18f9f630a815211

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for sktime-0.4.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 4b90a4fb58de3e9598f8b2d027a3da7ace4686def30bd453cbb0bc4e80300288
MD5 a42fdf773cc3accf148616bf168bb028
BLAKE2b-256 3e5ff08fc453927ea9d9c2ed19ad8e42b33ec8a90491bdff127027b16c42970f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f1b791652341275ee44e763b4e6e5c95088946bd11a6c266f6d08bbed16e452
MD5 c14f3d5618568c2fd61a9f22437a6c31
BLAKE2b-256 74508c5fa68c9483d23634277d78c7b73b5f56619d46fe5f4e42d3654990ba94

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f81f46250d39604854467c895f7a3149776cf887a67a244e8dce10a16a7515f4
MD5 6c251f8445979f7e6de6027fbe095a82
BLAKE2b-256 86702ec597c99adae03f70f0146285cb30c99f3eee04089bc67840e6d6d987b8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 0db5c4d264dfa8ae08a740032c9ab7971aa6d723bd87e37065280f201d6cb457
MD5 3d37d9b2abb15d2600a1de0b71a4d1ef
BLAKE2b-256 1beb925398efc442f8c4018e289195690e5aebb97934fd39d37a7899b4eac82d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.9

File hashes

Hashes for sktime-0.4.3-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 a3c412b9a9a705b02c216eb281c555952abf205b7b8e53cbff8bd649e11ec37c
MD5 0c6d19c4d70f3a85b5bce7b5cd3d283c
BLAKE2b-256 676f40343ed4aa9c668be391cd9324e7ce8a0a753db0e4fe5d47df1c762002ff

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

File hashes

Hashes for sktime-0.4.3-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 0479d3cff038da6741e9f166736a9b722436c4da4e8c313dfae7e5cb6db41f3f
MD5 ad639eae9b2c3fb6a6edc0d6b50432af
BLAKE2b-256 94145d37e5832bbdb19375a8f8d410a4baeb70f826c7b1c9312446cb3f8e184a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 5.6 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a8488a2d2238f540cbbb5bba47364d4ab1882a3a9ec239ff7d2ff54a562da526
MD5 a6870c820caf3142eeeb2f6196096d9a
BLAKE2b-256 8b85b58f26cf0e6404d80b365a318b9e49c6810a9ee00c44f039d65272ec4314

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 5.5 MB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2f64b74e3bf736d86bdfc380e974412c7a8b7539b650bed279a72bcafe1244ee
MD5 b2c32a7d0082b5b500ce8e39c7d69b39
BLAKE2b-256 b5cfa2d830df8efd3b289da489bf41d53f069a63624568766ca366907bd6dc01

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for sktime-0.4.3-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1cc8641078d4be89c12bb9a4961b4b645480120235a254cdbb379b8a173a5621
MD5 e4f2aaba1e82c34ec3f6cba2a0a95c61
BLAKE2b-256 74d303fcd032694311f7357d0fc6bd29f370f8057f0cbb239583055bfbae039a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sktime-0.4.3-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.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

File hashes

Hashes for sktime-0.4.3-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5da14e777fd6cba900a5450da0f81267d45d7d42bb4291e88805ad334eceeae4
MD5 420d4effa34cbc5715b10d7359ea0dc4
BLAKE2b-256 c232ce32c0d60d5511510739476ac16e8747dcbfdd127ab66df6238cd3321f0b

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