scikit-learn compatible Python toolbox for machine learning with time series
Project description
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()
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
Check out our examples notebooks - you can run them on Binder without having to install anything!
Read our detailed API reference.
Check out our previous tutorials and sprints.
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)
forecaster.fit(y_train)
y_pred = forecaster.predict(fh)
smape_loss(y_test, y_pred)
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!
Multivariate/panel forecasting based on a modified pysf API,
Unsupervised learning, including time series clustering,
Time series annotation, including segmentation and outlier detection,
Specialised data container for efficient handling of time series/panel data in a modelling workflow and separation of time series meta-data,
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
First check out our guide on how to contribute.
Chat with us or raise an issue if you get stuck or have questions.
Please also take a look at our Code of Conduct.
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:
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
Built Distributions
File details
Details for the file sktime-0.4.0.tar.gz
.
File metadata
- Download URL: sktime-0.4.0.tar.gz
- Upload date:
- Size: 5.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05e7cce9e9e093665102908d7ad1e03eb97a153896258f13c0fc7b0db6ea3417 |
|
MD5 | 2c6e9bf74ff8d6bb4ccb51c9a233d8f8 |
|
BLAKE2b-256 | 53f1e352a8b33df4b72380a64fe427d6d316f0654b5e65ca9a8f0fe3cff9aca5 |
File details
Details for the file sktime-0.4.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3523f6697027129cc4c4148697ebc01f31747aa16d4f420fdfa74b891eb184b5 |
|
MD5 | 95866ca0758a26f39d32186fc0f402d8 |
|
BLAKE2b-256 | e34afd623f4640d445588a33c322d6aa3cb3cae6347ee19c2b93ed2a9fbc098e |
File details
Details for the file sktime-0.4.0-cp38-cp38-manylinux2014_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp38-cp38-manylinux2014_x86_64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 362d738c2091dddeabd65477f73cbe413f84ab5c047f43d10c835ec6595f2c7b |
|
MD5 | 21bdbf20a4d191e06cd4b62c0acf3d5d |
|
BLAKE2b-256 | 427da6cfbc606abd5580bd64d53c8ca4782e4a90c58039dd64d41a80f0442854 |
File details
Details for the file sktime-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f101c58dec331231698e079ce43f23b3101d1024addba13fd9e5de9b1b7809d9 |
|
MD5 | bd1ab4641b51e0d7f8c3584c52a57636 |
|
BLAKE2b-256 | 426dcbfbdbd6c3a8dbcd1997c00840379a7f25637d009661cf514f1e79440f2b |
File details
Details for the file sktime-0.4.0-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01dbe6f15e32eb8e56e92d4e7b4bc2cc5296709ffe1edf92cd56de1bd3bb22cf |
|
MD5 | 1ffc86904eba5227e2c0aaa7e127ec61 |
|
BLAKE2b-256 | 52a29fb79d8576360638f2920b89d18c56a8057e9cc753511de9266cd37f8834 |
File details
Details for the file sktime-0.4.0-cp38-cp38-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp38-cp38-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.8, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 505e2fd9773dbe3b8fbe53e8b78bfd9f04855d53137dc8d1f74b0660e3ccecdc |
|
MD5 | fc0a1ad74989e267e30434a2f951f3f9 |
|
BLAKE2b-256 | 62c6232f57a80b538fe0ef0c02ebfc98b8db3f5b27b1051f1dc2060ed738adf1 |
File details
Details for the file sktime-0.4.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 760198233cbf8d0e01c43d70e4c39288dabf64ad5cd009376267609d3d314805 |
|
MD5 | 585ac34dcfcad6e72fddc14345468a35 |
|
BLAKE2b-256 | ffb40cd16de36c020f246a2a4ae47675a2458b12c1167dfe8045da6776cfe43c |
File details
Details for the file sktime-0.4.0-cp37-cp37m-manylinux2014_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp37-cp37m-manylinux2014_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 755ad4a976fb1ab80ae9551fea727dc5213e1b63d6ec7c58587b572530fe3aaf |
|
MD5 | 05c38f06808822e8b0f39b603cabff03 |
|
BLAKE2b-256 | ce39270e02db7962a68aee885b5f29c61a2167b76236da35694b19b053f40021 |
File details
Details for the file sktime-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23940037c80fb276a6c9151f5c498c19d3637c1b89ddb809a927db0b243e4f83 |
|
MD5 | eaec4082e1c5c8ea640257d46c9b943a |
|
BLAKE2b-256 | 2671986ab855ee1bb8a1cd5331213a23fb6ccba57e1686c64fe841acae935764 |
File details
Details for the file sktime-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 172c08b4d3feeba147ccca460e6f29a9a027a1c1036614d6676510dfd742a242 |
|
MD5 | f54b166ec709d3098e95423acdf39972 |
|
BLAKE2b-256 | cd02794298598a92f37510d88eada6f961b56215c4e87c2ebd1b8a1538cd5823 |
File details
Details for the file sktime-0.4.0-cp37-cp37m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp37-cp37m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.7m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a757352c2a76aa487e370e3d36b41e3e3befb9ee8e61cbd509654c671c9fcda5 |
|
MD5 | fd91ed1dd72586e7d1bd256b9bc5f5d1 |
|
BLAKE2b-256 | c73d78e85247a7dc0b04e4f0cb23c250d319493616457dfc8c88123b8781fd75 |
File details
Details for the file sktime-0.4.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b5ea34dc5fce731f16ae8c3be308b73053a66e52a7c863c33ac1e2e58eaba0b |
|
MD5 | 51c97e2dfdbd34ff40e40bf5c544eef6 |
|
BLAKE2b-256 | 13fe9e74dae34dd94423287b6d11f8f76d72835b9b78c59e897e812b682daf80 |
File details
Details for the file sktime-0.4.0-cp36-cp36m-manylinux2014_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp36-cp36m-manylinux2014_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7915c955a9e8d69769d4b70bc4d08543c28e971164abc030ae85dbe51cb4e447 |
|
MD5 | 6a00d7ab06882588770ce6f6150681bd |
|
BLAKE2b-256 | 773fe85ef863268283685e15cdc24e285abcea340151eba153dc9cce1765d2cf |
File details
Details for the file sktime-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66c6bae26f81312b5f75aacc93199c7e8abc72c82d2a7829c0905e26cca2cc25 |
|
MD5 | dd06134df26c57e364c29cabffcb97c4 |
|
BLAKE2b-256 | 7660a44c847f4fdef1257297395aecf9770d001e13a1f3705fca46da594ff67d |
File details
Details for the file sktime-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a61fcf8bfdac72c8a3afcf7ec9b3857ceea56afb7332ca460ec1d0c08d0d17a0 |
|
MD5 | ea2ee4fe6c36a64f112cef15fc69238f |
|
BLAKE2b-256 | 79cfa05b986aa2aaaf8f2df11ab6a41d2a19ce22d6dfaf4a4a45a3f239aa19db |
File details
Details for the file sktime-0.4.0-cp36-cp36m-macosx_10_13_x86_64.whl
.
File metadata
- Download URL: sktime-0.4.0-cp36-cp36m-macosx_10_13_x86_64.whl
- Upload date:
- Size: 2.6 MB
- Tags: CPython 3.6m, macOS 10.13+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05126e99ba5ef6359a3431801142cf688d7775bae9c58b014f5f9c5cb72b8ad6 |
|
MD5 | a371549591dd7157f57e4fc2f4d36a84 |
|
BLAKE2b-256 | 2dc36732a169feeca0c48b4083f725858965c579699c8967837fb134422db3c0 |