Skip to main content

A unified Python toolbox for machine learning with time series

Project description

A unified framework for machine learning with time series

We provide specialized time series algorithms and scikit-learn compatible tools to build, tune and validate time series models for multiple learning problems, including:

  • Forecasting,

  • Time series classification,

  • Time series regression.

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

CI

github appveyor azure codecov

Docs

readthedocs binder tutorial

Community

contributors gitter discord twitter

Code

pypi python codestyle zenodo

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

from sktime.forecasting.all import *

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)
smape_loss(y_test, y_pred)
>>> 0.08661468139978168

For more, check out the forecasting tutorial.

Time Series Classification

from sktime.classification.all import *
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 = TimeSeriesForest()
classifier.fit(X_train, y_train)
y_pred = classifier.predict(X_test)
accuracy_score(y_test, y_pred)
>>> 0.8679245283018868

For more, check out the time series classification tutorial.

Documentation

How to contribute

We follow the all-contributors specification - and all kinds of contributions are welcome!

If you have a question, chat with us or raise an issue. Your help and feedback is extremely welcome!

Development roadmap

  1. Multivariate/panel forecasting,

  2. Time series clustering,

  3. Time series annotation (segmentation and anomaly detection),

  4. Probabilistic time series modelling, including survival and point processes.

Read our detailed roadmap here.

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


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.5.2.tar.gz (38.0 MB view hashes)

Uploaded Source

Built Distributions

sktime-0.5.2-cp38-cp38-win_amd64.whl (4.3 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

sktime-0.5.2-cp38-cp38-manylinux2014_x86_64.whl (5.8 MB view hashes)

Uploaded CPython 3.8

sktime-0.5.2-cp38-cp38-manylinux2010_x86_64.whl (5.7 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

sktime-0.5.2-cp38-cp38-macosx_10_15_x86_64.whl (4.4 MB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

sktime-0.5.2-cp37-cp37m-win_amd64.whl (4.3 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

sktime-0.5.2-cp37-cp37m-manylinux2014_x86_64.whl (5.7 MB view hashes)

Uploaded CPython 3.7m

sktime-0.5.2-cp37-cp37m-manylinux2010_x86_64.whl (5.5 MB view hashes)

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

sktime-0.5.2-cp37-cp37m-macosx_10_15_x86_64.whl (4.4 MB view hashes)

Uploaded CPython 3.7m macOS 10.15+ x86-64

sktime-0.5.2-cp36-cp36m-win_amd64.whl (4.3 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

sktime-0.5.2-cp36-cp36m-manylinux2014_x86_64.whl (5.7 MB view hashes)

Uploaded CPython 3.6m

sktime-0.5.2-cp36-cp36m-manylinux2010_x86_64.whl (5.5 MB view hashes)

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

sktime-0.5.2-cp36-cp36m-macosx_10_15_x86_64.whl (4.4 MB view hashes)

Uploaded CPython 3.6m macOS 10.15+ x86-64

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