Written and maintained by CASRAI Editorial Board
Published
On this page
sktime is an open-source Python library that gives time series machine learning tasks (forecasting, classification, regression, clustering and annotation such as anomaly and change point detection) one common, scikit-learn-compatible interface. You install it with pip install sktime, load a series, fit an estimator and call predict; the same fit/predict pattern carries across every task, which is the reason researchers use it for comparing methods on their own data.
What sktime is used for in research
The project describes sktime as a unified framework for multiple time series machine learning tasks. Its documentation organises the library around learning tasks, each with a common interface for a given scientific purpose (a scientific type, or scitype). The tasks it currently supports are listed below, with the example estimator the official quickstart uses for each.
- Forecasting: predict future values of the input series.
- Time series classification: use the series of an instance to predict a categorical class.
- Time series regression: use the series of an instance to predict a continuous value.
- Time series clustering: discover groups of instances with similar series.
- Annotation / detection: outlier detection, anomaly detection, change point detection and segmentation.
The documentation distinguishes three kinds of time series data. Univariate data tracks a single variable over time. Multivariate data tracks several variables for the same instance, such as multiple sensor readings from one machine. Panel data tracks variables for multiple instances, such as the same indicators for several countries. Knowing which of the three your data is decides which estimators apply, so settle it before you choose a task.
sktime also supports reductions: composable classes that adapt one learning task to solve another. The official example is reducing forecasting to cross-sectional regression, where lags of the data are treated as independent features in scikit-learn-style tabular regression, or reducing anomaly detection to forecasting by flagging observations that sit too far from the forecast. For researchers this matters because a model you already know from scikit-learn can often be reused inside a time-aware pipeline. If you are new to that library, start with the scikit-learn tutorial for research.
Install or access
Install from the official sources only: the Python Package Index (PyPI) project page at pypi.org/project/sktime, or conda-forge. The installation page of the documentation gives these commands.
- Create and activate a clean environment first (venv or conda). A conda walk-through is in how to make a new conda environment.
- Run
pip install sktimefor the core package, orconda install -c conda-forge sktimewith conda. - Only if you need optional estimators, run
pip install sktime[all_extras](orconda install -c conda-forge sktime-all-extras, which installs only the optional dependencies available on conda-forge; the rest come through pip).
The installation page notes that most users do not need all_extras, which is slow to install; add individual optional (soft) dependencies as an estimator asks for them. PyPI lists sktime under the BSD-3-Clause licence and describes it as scikit-learn compatible, with a Zenodo DOI (10.5281/zenodo.3749000) you can cite in a methods section. PyPI showed version 1.3.0 when checked on 14 November 2026. The get-started page lists Python 3.10 to 3.14 and macOS, Unix-like systems and Windows 8.1 or higher; the PyPI listing states a Python requirement of 3.11 or newer and below 3.16, so use a Python version that satisfies both and confirm against PyPI when you install. To work from the development version, the documentation gives pip install git+https://github.com/sktime/sktime.git, or an editable install with pip install -e ".[dev]" from a clone.
Step-by-step: forecast a series and score it
This is the forecasting quickstart from the official get-started page, checked on 14 November 2026. It loads a bundled monthly dataset, holds out the end of the series, fits a Theta forecaster and scores the forecast on the held-out period.
- Import the pieces:
from sktime.datasets import load_airline,from sktime.forecasting.base import ForecastingHorizon,from sktime.forecasting.theta import ThetaForecaster,from sktime.performance_metrics.forecasting import mean_absolute_percentage_errorandfrom sktime.split import temporal_train_test_split. - Load the series:
y = load_airline(). - Split it in time order:
y_train, y_test = temporal_train_test_split(y). The split keeps the last part of the series for testing; it never shuffles. - Define the horizon from the test index:
fh = ForecastingHorizon(y_test.index, is_relative=False). - Create the forecaster with the seasonal period:
forecaster = ThetaForecaster(sp=12). The official comment on this line reads monthly seasonal periodicity. - Fit and predict:
forecaster.fit(y_train)theny_pred = forecaster.predict(fh). - Score it:
mean_absolute_percentage_error(y_test, y_pred).
To use your own data, replace step 2 with a pandas Series that has a time-based index (see pandas datetime handling and pandas resample for getting a regular frequency), and set sp to the number of observations in one seasonal cycle of your data. Swapping the model means swapping only the forecaster line, because every forecaster exposes fit and predict.
Other tasks use the same pattern
For classification the quickstart loads load_arrow_head(), splits with scikit-learn’s train_test_split, fits TimeSeriesForestClassifier() from sktime.classification.interval_based and scores with accuracy_score. For clustering it fits TimeSeriesKMeans(n_clusters=5, init_algorithm="forgy", metric="dtw") and plots the result with plot_cluster_algorithm. For detection it wraps a PyOD model, PyODDetector(IForest()) from sktime.detection.adapters, fits it on the airline series and calls predict to get the annotated series; that example needs the optional PyOD package. The data table below maps each task to its module and the estimator used in the quickstart.
Output and how to read it
The forecasting quickstart prints 0.08661467738190656. That number is the mean absolute percentage error (MAPE) of the forecast over the held-out period, written as a fraction: the average size of the error relative to the actual values, so 0.0866 corresponds to an average error of roughly 8.7 percent of the observed level. Lower is better, and a single MAPE says nothing by itself about whether Theta is a good choice; it becomes useful when you compare it with another forecaster scored on the same split.
Three details of the split matter when you report results. First, the default in temporal_train_test_split is documented as follows: if test_size is None and train_size is also None, the test size is set to 0.25, so a quarter of the series is held out; a float test size is rounded up to the next integer count and a float train size is rounded down. Second, y_pred is a pandas Series indexed by the test dates, so you can plot it against y_test directly. Third, the classification quickstart printed an accuracy of about 0.868 on its random split, which will differ from yours because train_test_split is random unless you set a seed; the forecasting split is deterministic, so a repeat run on the same data gives the same split.
For a methods section, state the sktime version, the Python version, the estimator and its parameters, the split rule and the metric, and cite the project through its Zenodo DOI. That is enough for another researcher to reproduce the run.
Troubleshooting
The installation page of the documentation covers the most common failures. The table below pairs each symptom with the cause and fix that page gives.
| Symptom | Cause and fix (installation page) |
|---|---|
| ModuleNotFoundError when using an estimator | The estimator needs a soft (optional) dependency that is not installed. Install that package, rather than the whole all_extras set. |
| ImportError right after a successful install | Often an inactive or unlinked virtual environment. In Jupyter, add the environment as a kernel and select it. |
| pip install sktime[all_extras] fails on Apple Silicon | The page notes that some all_extras dependencies fail there; install only the extras you need. |
| Build problems on Windows | The page suggests using the Windows Subsystem for Linux (WSL). |
| The all_extras install is very slow | Expected: the page says most users do not need it. Add soft dependencies individually. |
Free alternatives
Several open-source Python libraries cover overlapping ground. Each row below is taken from the project’s own documentation, read on 14 November 2026. They differ in emphasis rather than one replacing another, and the right one depends on the task and on whether you want a scikit-learn-style interface.
| Library | What its own documentation says |
|---|---|
| statsmodels | A Python module for estimating many different statistical models, conducting statistical tests and exploring data, released under the Modified BSD (3-clause) licence; its time series analysis section is the tsa package. See also forecasting in R for the R counterpart. |
| aeon | A scikit-learn compatible toolkit for time series machine learning tasks such as classification, regression, clustering, anomaly detection, segmentation and similarity search, built on top of scikit-learn. |
| Darts | A Python library for user-friendly forecasting and anomaly detection on time series, from classical models such as ARIMA to deep neural networks, with fit() and predict() usage similar to scikit-learn and support for probabilistic forecasting. |
Frequently asked questions
What is sktime?
sktime is an open-source Python library for machine learning with time series. It provides a unified, scikit-learn-compatible interface for forecasting, classification, regression, clustering and annotation tasks.
How do I install sktime?
Run pip install sktime in a clean Python environment, or conda install -c conda-forge sktime. Add pip install sktime[all_extras] only if you need optional dependencies, since most users do not.
Which Python versions does sktime support?
The get-started page lists Python 3.10 to 3.14; the PyPI listing states 3.11 or newer and below 3.16. Use a version that satisfies both and confirm on PyPI at install time.
What does the sktime forecasting example output mean?
It is the mean absolute percentage error of a Theta forecast on the held-out final quarter of the airline series, printed as 0.0866 in the official quickstart. Lower is better, and it is meaningful mainly when compared with another model on the same split.
Is sktime free to use and cite?
sktime is listed on PyPI under the BSD-3-Clause licence and has a Zenodo DOI, 10.5281/zenodo.3749000, that can be cited in a methods section.
Sources
- sktime documentation, Get started: https://www.sktime.net/en/stable/get_started.html (read 14 November 2026).
- sktime documentation, Installation: https://www.sktime.net/en/stable/installation.html (read 14 November 2026).
- sktime documentation, temporal_train_test_split API: https://www.sktime.net/en/stable/api_reference/auto_generated/sktime.split.temporal_train_test_split.html (read 14 November 2026).
- sktime on PyPI: https://pypi.org/project/sktime/ (read 14 November 2026).
- statsmodels documentation: https://www.statsmodels.org/stable/index.html; aeon documentation: https://www.aeon-toolkit.org/en/stable/; Darts documentation: https://unit8co.github.io/darts/ (all read 14 November 2026).
Data: sktime learning tasks, modules and quickstart estimators
Maps each learning task supported by sktime to the module path and the example estimator used in the official get-started quickstart, compiled from the sktime documentation read on 2026-11-14.
Period covered: 2026.
| Learning task | Quickstart estimator or class | Module path | Quickstart dataset |
|---|---|---|---|
| Forecasting | ThetaForecaster(sp=12) | sktime.forecasting.theta | load_airline |
| Time series classification | TimeSeriesForestClassifier | sktime.classification.interval_based | load_arrow_head |
| Time series regression | KNeighborsTimeSeriesRegressor | sktime.regression.distance_based | load_covid_3month |
| Time series clustering | TimeSeriesKMeans(n_clusters=5, init_algorithm="forgy", metric="dtw") | sktime.clustering.k_means | load_arrow_head |
| Detection (annotation) | PyODDetector(IForest()) | sktime.detection.adapters | load_airline |
Sources
- sktime documentation: Get started (accessed 2026-11-14)
Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.







