Skip to main content

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

Project description

travis appveyor azure pypi gitter binder zenodo

sktime

sktime is Python toolbox for machine learning with time series. 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 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, and 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.1

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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8

sktime-0.4.1-cp38-cp38-manylinux2010_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

sktime-0.4.1-cp38-cp38-manylinux1_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.8

sktime-0.4.1-cp38-cp38-macosx_10_13_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.8 macOS 10.13+ x86-64

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

Uploaded CPython 3.7m Windows x86-64

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

Uploaded CPython 3.7m

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

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

sktime-0.4.1-cp37-cp37m-manylinux1_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.7m

sktime-0.4.1-cp37-cp37m-macosx_10_13_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.7m macOS 10.13+ x86-64

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

Uploaded CPython 3.6m Windows x86-64

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

Uploaded CPython 3.6m

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

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

sktime-0.4.1-cp36-cp36m-manylinux1_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.6m

sktime-0.4.1-cp36-cp36m-macosx_10_13_x86_64.whl (4.2 MB view details)

Uploaded CPython 3.6m macOS 10.13+ x86-64

File details

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

File metadata

  • Download URL: sktime-0.4.1.tar.gz
  • Upload date:
  • Size: 9.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

File hashes

Hashes for sktime-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f066ce462b5f6013391ec7697471a22e6f67af70b85e670202fed02ac87488b1
MD5 2c105ac10df03e776b259053eee1ba2e
BLAKE2b-256 783cd83905ef49dada6281585f9bf9a294a76798a90b60f459d0228f0614aa58

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e688f0119120beee17ddf902f5cf5deafa063080ca788fa36694c2752628c0d3
MD5 0937fdc96cb04390dd8ba10d74214285
BLAKE2b-256 10ec98d2a62a69e3b6edea452b823952adae849bf0d3042110548bb06daded0a

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4c4e1d91d795acb578645906126c384d6f167bc7cbd404e0d30061be76a2182
MD5 c4118af4038947b0b4c636a3d06e4e05
BLAKE2b-256 b34980daba916eee97a084e79ad18e0ec60708460e56d3f4a0cb1b8703fce57b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 5.5 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 2ad8e6a4874c680d94fd96a794f79cf3153ad53b4d3933be9a080a90aec389c7
MD5 fdd84416d6f76fe7572fb9a2171626f1
BLAKE2b-256 0c7e750fe0fc1c55162b5b7b2d664ba7d9835e4564139b9ca97d2daad78f83d8

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp38-cp38-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.1 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7309c6a623f7c5001efe7c82418255656ebb133a8698c3612c7e0355d8b7f399
MD5 1a2499ddd31e8c34723897f3fa7934f9
BLAKE2b-256 7a3a278a5ce34889450c3a2c74c9813d66a1ee40a3f8adf3e44e732753dccd6a

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp38-cp38-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 4.2 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/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp38-cp38-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 529d87c7803893372043c4d57acc0aba6743d202f5c2d5bc33060fdf66c6c035
MD5 0b2fdd3b197eb88250df2c35160c43bd
BLAKE2b-256 99689599ea6af8fa65c1cc9132ac8a8fd0334250f05305408dd3d0b58c339154

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for sktime-0.4.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 d7fbcaa6fd01390b408ad0f41e7b15cf4a3750fa8694dd3b1f2eb47d1cb41e51
MD5 eeeb0e645e305f87f939138842da4130
BLAKE2b-256 6fe289c6af281e2180b2725c55dd647736da0035dd9f260b8fc559f73bf06b57

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 aa2921ba8321ebeb11713013d3e6bbb7c881e539e38ffe38a969feb55f4faa0d
MD5 8e4d365ba093181ece2be897dccc27fc
BLAKE2b-256 440763ad9bf5bd5d8d206c31255f4afb1475270f31843c9214b9e0dec45f973b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 54aa311810051651479dc2e989c23e846b8d1beb02ab8cd333c5cf97d6a24150
MD5 6cad30d30da6ef5a36490b817429b5d7
BLAKE2b-256 fa2c6f19ea8c537b78a1d2d83207dc4ebf45e337e44ec524b5318e5ae3a7c27b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.1 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ac13950a5053ec4270bb7f98ae85b2e8f71db01af0c704d721da5d6882423993
MD5 fda845f2671dd362a09d93d31fcbeed7
BLAKE2b-256 b6fcec7c0404a16c2c1c21043dff70c399b49ec304a13dd4e7d0498c9be02b3a

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp37-cp37m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 4.2 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/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for sktime-0.4.1-cp37-cp37m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 9ea7da3c283d462debaa4aca15c6a6b47ced2efaa0764dcf99b3d451b2335a12
MD5 c98f732551590550908c7362b8210774
BLAKE2b-256 71905afbb22d0fcd41e0bc9a09b42112d53d02f802cebbc41c1e08ffbcd03d87

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

File hashes

Hashes for sktime-0.4.1-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c183786144cd00940c0c027f9008df9f52e87265b8877f136b7330b0fcfad7db
MD5 7da095f761c7bb86807bff4a9dd1312b
BLAKE2b-256 d0d9f95c17d59bb6cdaa503dabe0607d7da78571b3e85df85146ad833573fe3c

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24bd7c019ae10e2c882dfa558d92205336801fe1ac9e874ae1967bf190eac6af
MD5 b4b2723ba842c309c2cf6eeefd0a4a29
BLAKE2b-256 34f8c4d9c83406245dc13aeb248bd9a8df1b35fd76dd815672d5090259c83dcc

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 98e5fb9252afeffe3624ae66512b7833a4dfc9b241aaf08958c8e3ab047768e1
MD5 e8d3a90500975e8792009e549387c536
BLAKE2b-256 25ce60ff4942888bb99558f775c8e69a47ba0045b0f32038225e32dd8e49c952

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 5.1 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for sktime-0.4.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 698a20d3ce3f4fa1c9245dd5f7e6fbe7f49de1f992925851499aba214ba2d3bf
MD5 dbc4b113102fe7bdf6fe12185acf1766
BLAKE2b-256 500a54642ff237ef5cf19deae90a9474c179f8c4cb1348e5277657f8e0e5688c

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: sktime-0.4.1-cp36-cp36m-macosx_10_13_x86_64.whl
  • Upload date:
  • Size: 4.2 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/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10

File hashes

Hashes for sktime-0.4.1-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 fa46273ee3e8e0ccdbc1c4bd3c49bff015c492083ebd4c63c1589a2bfdc88c26
MD5 b0d70d360d1c590ebeeddcd0ac5ab41d
BLAKE2b-256 fc569390c03751c6043ad2225256befef7895b3d3198d1693cd3f58562275246

See more details on using hashes here.

Provenance

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