Forecasts multiple related time series simultaneously using global models like ForecasterRecursiveMultiSeries or ForecasterDirectMultiVariate. Covers data formats, encoding, per-series transformers, and multi-series backtesting.
Ships in skforecast. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
choosing-a-forecaster (decide between MultiSeries, MultiVariate, Rnn, or Foundation for multi-series problems)autocorrelation-and-lag-selection (analyse representative series to inform the shared lags argument)feature-engineering (build per-series exogenous and rolling features)hyperparameter-optimization (tune the global model across series)prediction-intervals (add intervals to the multi-series forecasts)Scan before writing code. Each row lists a rule, the symptom when it is broken, and the recovery. Full pitfall catalog: the troubleshooting-common-errors skill.
| Rule | Symptom | Recovery |
|---|---|---|
Use backtesting_forecaster_multiseries and the *_multiseries search functions | backtesting_forecaster / grid_search_forecaster raises on a multi-series forecaster | Call the _multiseries variant with series= instead of y= |
ForecasterDirectMultiVariate defaults to transformer_series=StandardScaler() | Series are scaled unexpectedly (other forecasters default to None) | Pass transformer_series=None explicitly if you do not want scaling |
exog and series formats can be combined (wide, long or dict); a dict or long exog is matched to the series by name | MissingExogWarning about series without exog, whose exog values are NaN | Use the series names as the keys of the exog dict (or the series IDs of a long exog). A wide exog is shared by all series and aligned with each one by date |
Regressors with native categorical support need encoding='ordinal_category' | Categoricals silently encoded as plain ordinals, degrading the model | Set encoding='ordinal_category' for LightGBM / CatBoost / XGBoost / HistGBR |
ForecasterRecursiveMultiSeries accepts three input formats:
Wide DataFrame — columns are series, index is datetime:
# series_1 series_2 series_3
# 2020-01-01 1.0 2.5 3.1
# 2020-01-02 1.2 2.3 3.4
Dictionary — {series_id: pd.Series}:
{'series_1': pd.Series([1.0, 1.2, ...]), 'series_2': pd.Series([2.5, 2.3, ...])}
Note: Long-format DataFrames are not directly accepted. Use
reshape_series_long_to_dict()to convert long format to a dictionary first (see Data Reshaping Utilities below).
import pandas as pd
from lightgbm import LGBMRegressor
from skforecast.recursive import ForecasterRecursiveMultiSeries
from skforecast.model_selection import backtesting_forecaster_multiseries, TimeSeriesFold
# 1. Load data as wide DataFrame (columns = series)
series = pd.read_csv('data.csv', index_col='date', parse_dates=True)
series = series.asfreq('D')
# 2. Create forecaster
forecaster = ForecasterRecursiveMultiSeries(
estimator=LGBMRegressor(n_estimators=200, random_state=123),
lags=24,
encoding='ordinal', # 'ordinal', 'ordinal_category', 'onehot', or None
transformer_series=None, # Apply same transformer to all series
# Per-series options (dict):
# transformer_series={'series_1': StandardScaler(), 'series_2': MinMaxScaler()},
# weight_func={'series_1': custom_weights_fn, '_default': None},
# differentiation={'series_1': 1, 'series_2': None},
categorical_features='auto', # Auto-detect and encode non-numeric exog columns
differentiation=None,
dropna_from_series=False, # True to drop NaN rows; False to keep (NaN-tolerant estimators)
)
# 3. Train
forecaster.fit(series=series)
# 4. Predict all series
predictions = forecaster.predict(steps=10)
# 5. Predict specific series only
predictions = forecaster.predict(steps=10, levels=['series_1', 'series_2'])
# 6. Backtesting (multi-series)
cv = TimeSeriesFold(
steps=10,
initial_train_size=len(series) - 100,
refit=False,
)
metric, predictions_bt = backtesting_forecaster_multiseries(
forecaster=forecaster,
series=series,
cv=cv,
metric='mean_absolute_error',
levels=None, # Evaluate all series
)
print(metric) # Shows per-series and aggregated metrics
# Exog can also be wide DataFrame, long DataFrame, or dict
forecaster.fit(series=series, exog=exog_df)
predictions = forecaster.predict(steps=10, exog=exog_test)
from skforecast.direct import ForecasterDirectMultiVariate
# Predicts ONE target series using lags from ALL series as features
# Note: transformer_series defaults to StandardScaler() (unlike other forecasters)
forecaster = ForecasterDirectMultiVariate(
level='target_series', # Name of the series to predict
steps=10,
estimator=LGBMRegressor(n_estimators=100, random_state=123),
lags=24, # Or dict: {'series_a': 12, 'series_b': 24}
transformer_series=StandardScaler(), # Default — set None to disable scaling
categorical_features='auto', # Auto-detect and encode non-numeric exog columns
dropna_from_series=False, # True to drop NaN rows; False to keep (NaN-tolerant estimators)
)
forecaster.fit(series=series_df)
predictions = forecaster.predict()
from skforecast.preprocessing import (
reshape_series_wide_to_long,
reshape_series_long_to_dict,
reshape_exog_long_to_dict,
reshape_series_exog_dict_to_long,
)
# Wide → Long
series_long = reshape_series_wide_to_long(series_wide)
# Long → Dict (freq is required)
series_dict = reshape_series_long_to_dict(series_long, freq='D')
exog_dict = reshape_exog_long_to_dict(exog_long, freq='D')
dropna_from_series=True.encoding='ordinal_category' with regressors that natively handle categoricals (LightGBM, CatBoost).MissingExogWarning).levels parameter: By default predict() forecasts all series. Use levels to limit predictions.transformer_series defaults to StandardScaler(), unlike other forecasters that default to None. Set transformer_series=None explicitly if you don't want automatic scaling.n_evaluated of the backtesting metrics and of the *_multiseries search results counts the points in each metric; when it differs between candidates, the search warns (MissingValuesWarning). Pass in levels the series that every candidate predicts in every fold to compare them on the same points (see the hyperparameter-optimization skill).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/skforecast:forecasting-multiple-seriesfrom skforecast
npx claudepluginhub skforecast/skforecast --plugin skforecast17 skills in this plugin
/autocorrelation-and-lag-selectionAnalyzes time series dynamics with the fast skforecast.stats functions acf, pacf and calculate_lag_autocorrelation. Covers reading ACF/PACF patterns to identify AR/MA orders and seasonality, ranking lags by partial autocorrelation, and feeding the result to the lags argument of any skforecast forecaster. Use when the user wants to understand the dynamics of a series, choose a candidate set of lags before hyperparameter tuning, or replace a slow statsmodels acf/pacf call.
/backtesting-configurationConfigures TimeSeriesFold parameters for backtesting based on deployment scenarios. Maps business requirements (retraining frequency, forecast horizon, data budget) to cross-validation strategy parameters. Use when the user describes how they plan to deploy or evaluate a model.
/baseline-forecastingBuilds and evaluates simple baseline forecasts with ForecasterEquivalentDate (equivalent-date / seasonal-naive / moving-average) to benchmark machine learning models. Covers offset (int vs pandas DateOffset), n_offsets with agg_func, backtesting a baseline, comparing against ML with MASE, conformal intervals, and grid_search_equivalent_date. Use when the user wants a baseline, a naive or seasonal reference, or to check whether a model beats a simple rule. Not for choosing among ML forecasters (see choosing-a-forecaster) or tuning ML hyperparameters (see hyperparameter-optimization).
/choosing-a-forecasterGuides selection of the appropriate skforecast forecaster based on the user's data characteristics and requirements. Provides a decision matrix mapping use cases to forecaster classes. Use when the user is unsure which forecaster to use or asks for a recommendation.
/complete-api-referenceProvides complete constructor and method signatures for all skforecast forecasters, backtesting functions, search functions, cross-validation classes, preprocessing, feature selection, and drift detection. Use when the user needs exact parameter names, types, or defaults for any skforecast class or function.
/deep-learning-forecastingForecasts time series using recurrent neural networks (RNN, LSTM, GRU) with ForecasterRnn and the create_and_compile_model helper. Covers model architecture, training, and multi-series deep learning. Use when the user wants to use deep learning / neural networks for time series forecasting.
Other plugins' skills for the same job