sktime is an open-source Python framework for machine learning with time series that offers a unified, scikit-learn compatible interface for forecasting, time series classification, regression, clustering, detection and transformations. In time series & forecasting work, it lets practitioners swap, compose and tune models through one consistent API instead of learning a different interface for every statistical or machine learning package.
The project began around 2019 in an academic setting in the United Kingdom and is now maintained by an independent community under a permissive BSD-3 license. Its design goal is not to reimplement every algorithm but to provide a common layer of estimators, pipelines and evaluation tools that also wraps libraries such as statsmodels, pmdarima and statsforecast.
How sktime structures time series learning
sktime organizes functionality around task-specific estimator types, each with a defined interface. A forecaster is fitted on past values with fit and returns future values with predict, while the forecasting horizon states which future steps are needed, either relative to the cutoff or as absolute time points.
Every estimator carries tags that describe its capabilities, for example whether it supports exogenous covariates, missing values, multivariate input or probabilistic output. The framework uses these tags to check inputs and convert data formats automatically, so the same forecaster can accept a pandas Series, a DataFrame or a hierarchical MultiIndex frame.
The table lists the main learning tasks and the base interface each one exposes.
| Task | Base estimator type | Typical output |
|---|---|---|
| Forecasting | Forecaster | Future values, intervals or quantiles |
| Time series classification | Classifier | Class label per series |
| Time series regression | Regressor | Numeric value per series |
| Clustering | Clusterer | Cluster assignment per series |
| Detection and segmentation | Detector | Anomalies, change points or segments |
| Transformation | Transformer | Changed series or extracted features |
Key building blocks for forecasting
The forecasting module is the most widely used part of sktime, and its strength lies in composition. Simple forecasters can be combined with transformers, reduction wrappers and tuning objects to build complex models that still behave like a single estimator with fit and predict.
The table describes the components that appear most often in forecasting code.
| Component | Purpose | Example use |
|---|---|---|
| ForecastingHorizon | Defines the steps to predict | Steps 1 to 12 for a monthly year ahead |
| Reduction wrapper | Turns a tabular regressor into a forecaster | Gradient boosting with lag features |
| TransformedTargetForecaster | Chains transformations on the target | Deseasonalize, detrend, then forecast |
| ForecastingPipeline | Transforms exogenous covariates | Scaling or imputing external drivers |
| Temporal splitters | Create expanding or sliding windows | Backtesting over rolling origins |
| ForecastingGridSearchCV | Tunes hyperparameters with temporal splits | Choosing a seasonal period or lag count |
Reduction deserves attention because it links classical machine learning with forecasting. sktime can apply a regressor through a recursive or direct forecasting strategy, and the choice affects error accumulation over long horizons.
sktime compared with other forecasting libraries
sktime is a general-purpose framework rather than a single-model package, which shapes where it fits best. Specialized libraries often provide faster implementations of one family of models, while sktime focuses on interoperability, composition and evaluation across many families.
The comparison below places sktime among neighboring tools that practitioners often consider.
| Library | Main focus | Relationship to sktime |
|---|---|---|
| sktime | Unified interface for many time series tasks | Framework layer |
| statsmodels | Statistical models such as ARIMA and ETS | Wrapped as sktime forecasters |
| statsforecast | Fast statistical forecasting at scale | Partly interfaced through adapters |
| Prophet | Additive trend and seasonality model | Available through an adapter |
| GluonTS | Probabilistic deep learning forecasters | Separate ecosystem with its own API |
| Darts | Forecasting with classical and neural models | Similar goal, different interface design |
Evaluation and probabilistic forecasting in sktime
sktime provides time series cross-validation through splitters and an evaluate function that refits or updates the model at each cutoff. This rolling-origin backtesting avoids the leakage that a random train-test split would cause in temporal data.
Built-in metrics include MAE, MAPE, sMAPE and MASE, as well as probabilistic scores such as pinball loss and interval coverage. Forecasters that support it expose predict_interval, predict_quantiles and full distribution predictions, which allows probabilistic forecasting within the same workflow as point forecasts.
For grouped data, sktime handles hierarchical and panel series through pandas MultiIndex frames. A forecaster can be fitted per series automatically, and reconciliation transformers align forecasts so that lower levels add up to the totals above them.
In production, forecasters also support an update method that ingests new observations and moves the cutoff forward without a full refit. This mirrors how forecasts are used operationally, where a model is retrained on a schedule but refreshed with each new data point. Backtests can emulate either behavior, and the choice should match the planned deployment so that measured accuracy reflects real use.
Practical choices, limitations and common mistakes
sktime is most useful when a team needs to compare many model families under one evaluation protocol. It is less suited to training large deep learning forecasters on millions of series, where specialized frameworks with GPU pipelines are usually faster.
The following table lists frequent problems and how to avoid them.
| Mistake | Consequence | Fix |
|---|---|---|
| Index without a frequency | Horizon conversion errors | Set a regular DatetimeIndex or PeriodIndex |
| Random cross-validation | Leakage and optimistic scores | Use expanding or sliding window splitters |
| Ignoring estimator tags | Unsupported input errors | Check tags before composing models |
| Exogenous data missing at predict | Prediction failure | Supply future covariates for the horizon |
| Unpinned dependencies | Changed behavior after upgrades | Pin sktime and soft dependency versions |
Because many estimators rely on optional soft dependencies, installation size and compatibility vary with the models a project uses. Teams should install only the extras they need and test upgrades in a separate environment.
A further misconception is that a unified interface makes models interchangeable in quality. sktime standardizes how models are called, not how well they suit the data, so baselines such as the naive forecast remain essential reference points.
A plain-language summary
sktime is a toolbox for data that changes over time, such as daily sales or hourly temperatures. Many forecasting tools exist, and each one works a little differently. sktime puts them behind one common set of buttons.
You train a model the same way each time. You ask for predictions the same way each time. This makes it easy to try several methods and keep the best one. It also helps you test them fairly, by always predicting the future from the past.
An example from practice
A data team at a regional grocery chain needs weekly demand forecasts for about 800 products across 40 stores. The analysts want to compare a seasonal naive baseline, an ETS model, an ARIMA model and a gradient boosting model built on lag features.
Using sktime, they store the data as a hierarchical frame indexed by store, product and week. They wrap the gradient boosting regressor with a reduction wrapper, add a deseasonalizing step in a TransformedTargetForecaster and run expanding-window backtests over the last 52 weeks. All four candidates use the same splitter and the same MASE metric.
The comparison shows that ETS wins for slow-moving items, while the boosting model performs best for promoted products. The team selects different models per product group and applies reconciliation so store totals match chain totals. Forecast error on the backtest falls noticeably compared with the previous spreadsheet method.