Source-linked AI summary

sktime: A Unified Interface for Machine Learning with Time Series

Markus Löning, Anthony Bagnall, Sajaysurya Ganesh, Viktor Kazakov, Jason Lines, Franz J. Király

arXiv:1909.07872v1cs.LGstat.ML

TL;DR

Time-series machine learning spans related tasks, but existing open-source tools are limited and often incompatible. The paper presents sktime, a scikit-learn-compatible unified API using reduction and composition, and reports correctness testing plus reproduced comparative benchmarks.

  • Problem

    Existing open-source time-series machine-learning capabilities remain limited, with libraries often incompatible and interfaces fragmented across tasks.

  • Method

    sktime extends scikit-learn’s interface to multiple time-series tasks, representing reduction approaches as composable meta-estimators with tunable choices.

  • Results

    The majority of implemented algorithms were correctness-tested against implementations in other languages and benchmarked on archive data, reproducing results from a comparative study.

  • Takeaways & Limitations

    A unified scikit-learn-compatible interface supports linked time-series tasks and enables reduction strategies to be evaluated and compared as configurable components.

  • Takeaways & Limitations

    The task notation does not cover time-heterogeneous settings, although the sktime interface does cover them.

Abstract

from arXiv · show

We present sktime -- a new scikit-learn compatible Python library with a unified interface for machine learning with time series. Time series data gives rise to various distinct but closely related learning tasks, such as forecasting and time series classification, many of which can be solved by reducing them to related simpler tasks. We discuss the main rationale for creating a unified interface, including reduction, as well as the design of sktime's core API, supported by a clear overview of common time series tasks and reduction approaches.

1 Introduction

sktime is an open-source Python library extending scikit-learn-style machine learning to temporal data through a unified interface for multiple time series tasks. The interface addresses fragmented existing tooling and supports composable reductions, shared functionality, and a growing set of algorithms and utilities.

  • Motivation: sktime extends existing machine learning capabilities, notably scikit-learn, to time series through a unified interface for several learning tasks.It is presented as an open-source Python library for machine learning with time series.
  • Time series tasks: Time series applications generate distinct but closely related tasks, including classification, forecasting, and annotation.Examples include industrial sensors, chemical spectroscopy, and bedside medical monitoring.
  • Existing tooling: Existing time series toolboxes are often task- or model-specific, incompatible with one another, and limited in open-source machine learning capabilities.Available interfaces target areas such as ARIMA, neural networks, forecasting, feature extraction, annotation, and classification.
  • API rationale: A unified, composable API supports reductions from complex tasks to simpler related tasks while reducing code replication, confusion, and inappropriate reductions.The paper gives time series segmentation reduced to supervised learning as an example and notes common needs such as distance measures and preprocessing routines.
  • Contributions: sktime includes state-of-the-art time series classification algorithms, modular reduction, pipelining, ensembling and transformation functionality, forecasting methods, and benchmarking tools.These components are described as currently available functionality in the library.

2 Taxonomy of time series learning tasks

The section defines time series as observations paired with known time points and distinguishes univariate, multivariate, and panel data. It then categorizes learning tasks including time series regression/classification, forecasting, and annotation.

  • Data forms: A time series consists of observations together with the finite set of time points at which they are observed.sktime represents this information as a sequence or indexed collection of time/value pairs.
  • Data forms: Data may be univariate, multivariate across variables within one unit, or panel data comprising multiple independent instances of the same measurements.Panel instances may themselves be multivariate, while time points can vary across variables or instances.
  • Time series regression/classification: Time series regression and classification learn predictors from N i.i.d. feature-label instances whose features include time series, predicting real-valued or finite-class targets.Time-invariant features may also be present; relative to tabular supervision, some features are time series rather than primitives.
  • Forecasting: Forecasting predicts future values over a horizon without an i.i.d. assumption, with variants based on related series, joint series prediction, and horizon placement.The taxonomy distinguishes exogeneity from vector forecasting and in-sample from other forecasting horizons.
  • Time series annotation: Time series annotation predicts annotations for a single observed series, including change points and their types in change-point detection.The annotation task varies according to the annotations’ value domain and interpretation relative to the input series.

3 Reductions with time series

Time-series learning tasks are distinct but closely related, enabling reductions that decompose complex problems into simpler tasks whose solutions are recombined. These reductions also provide a modular API design in which base algorithms and reductions can be transferred and composed across tasks.

  • Reduction concept: Reduction decomposes a learning task into simpler tasks whose solutions can be composed into a solution for the original task.The paper gives one-vs-all classification as a classical tabular example and presents reduction as applicable to time-series tasks.
  • Reduction advantages: Reductions convert any algorithm for a particular task into a learning algorithm for a new task, transferring progress on the base algorithm.This transfer can save research and software development effort.
  • Reduction advantages: Reductions are modular and composable: applying one reduction to n base algorithms produces n algorithms for the new task.The same compositionality supports chaining reductions for more complicated problems.
  • Reduction composition: Forecasting can be reduced to time series regression, which can in turn be reduced to tabular regression.This example illustrates how reductions connect related learning tasks in a composed pipeline.
  • Reduction advantages: Reductions clarify the relationships between learning tasks and help reduce confusion between them.This conceptual benefit complements their algorithmic and API-design advantages.

4 API design

sktime extends scikit-learn’s interface to multiple time series tasks through unified estimators, transformers, data containers, and composable meta-estimators. Its API exposes task-specific functionality and reduction choices while supporting multivariate and panel time series.

  • Unified interface: sktime extends scikit-learn’s syntax and logic to create a unified API for multiple time series tasks and reuse scikit-learn algorithms.This reuse is especially useful when reducing time series problems to tabular tasks or combining specialised time series algorithms with tabular supervised learners.
  • Data representation: The data container supports multivariate and panel data, time-constant features, and time-heterogeneous series with varying observed lengths and time points.
  • Estimators: Estimators share fit, predict, and hyper-parameter interfaces, while task-specific components extend scikit-learn regressors and classifiers and add forecasters.
  • Transformers: Transformers share fit, transform, inverse-transformation when available, and hyper-parameter interfaces across tabular, series-to-primitives, series-to-series, and detrending transformations.These transformation types cover i.i.d. instances, per-instance time-series feature extraction, series-valued outputs, and detrending that preserves the input domain.
  • Meta-estimators: Reduction strategies are composable meta-estimators with explicit hyper-parameters, exposing modelling choices such as sliding-window width and step length.Meta-estimators retain the estimator API and can be composed with pipelines, ensembles, model selection, and modular multivariate compositions such as columnwise ensembling and column concatenation.

5 API overview

sktime’s API overview covers time series classification, classical forecasting, transformers, composition, and benchmarking. Implemented algorithms were tested against implementations in other languages and benchmarked on archive data, with some benchmarking reproductions ongoing.

  • Time series classification: sktime includes state-of-the-art algorithms for time series classification.The listed classification functionality spans interval-, distance-, shapelet-, dictionary-, and deep-learning-based methods.
  • Classical forecasting: sktime implements classical statistical forecasting techniques and reduction strategies using supervised learning algorithms.The statistical techniques interface with statsmodels whenever possible.
  • Transformers: Transformers support time-series segmentation, series-to-primitives and series-to-series feature extraction, detrending, and time binning for tabular learning.Time binning reduces time series regression or classification to tabular supervised learning.
  • Composition: Composition provides scikit-learn-style pipelining for feature and target variables alongside multivariate composite strategies.These composition capabilities follow scikit-learn’s API.
  • Validation and benchmarking: Most implemented algorithms were correctness-tested against implementations in other languages and benchmarked on archive data.sktime reproduced a comparative benchmarking study’s results and was still recreating results from forecasting benchmarking studies.

6 Conclusion and future directions

The paper concludes by emphasizing sktime’s unified time-series interface and key API features, including reduction meta-estimators and multivariate ensembling. It identifies future development around task-specific interfaces and reduction approaches, while noting that most current methods support only equal-length series.

  • sktime provides a unified interface for machine learning with time series, including meta-estimators for reduction and multivariate ensembling.
  • Future development focuses on implementing task-specific interfaces and reduction approaches, with the project seeking contributors.
  • Most methods currently support only equal-length series.

Authors’ contributions

The authors contributed to sktime’s conception, architecture, implementation, benchmarking, and manuscript preparation. Individual contributions covered core interfaces, algorithms, classification, framework development, benchmarking, and final manuscript review.

  • Architecture and implementation: ML contributed to sktime’s architecture, design, reduction interfaces, implementation, maintenance, and most of the manuscript.ML implemented or contributed to almost all parts, including the overall framework, forecasting module, and specific algorithms.
  • Architecture and implementation: FK conceived the project and architectural outlines, including task taxonomy, composition, and reduction, and contributed to manuscript writing.
  • Algorithms and interfaces: AB implemented time series forest and the random interval spectral ensemble, while JL developed modular interfaces for distance-based algorithms and the shapelet transform.JL also implemented Cython time series distance functions and time series k-nearest-neighbours interfaces.
  • Classification, benchmarking, and manuscript: SG contributed to time series classification design and implementation, VK contributed to benchmarking based on mlaut, and all authors reviewed and finalized the manuscript.Finalization included copy-editing and proof-reading.
Loading 1909.07872v1…