pip install "sktime[all_extras]"★Base install is light; extras pull in soft deps (statsmodels, pmdarima, prophet, etc.). Install only what you use in prod.y = pd.Series(values, index=pd.PeriodIndex(..., freq="M"))★A univariate series with a proper time index (PeriodIndexpreferred;DatetimeIndex/RangeIndexalso work).# panel/multi-series: pd.DataFrame with a MultiIndex (instance, time)Hierarchical/multiple series use a MultiIndex; the same forecasters vectorize over instances.from sktime.datasets import load_airline y = load_airline()Built-in datasets for experiments & docs examples.
from sktime.forecasting.naive import NaiveForecaster f = NaiveForecaster(strategy="last") f.fit(y, fh=[1,2,3]); f.predict()★Fit, then predict the forecasting horizon. Always establish a naive baseline first.from sktime.forecasting.base import ForecastingHorizon fh = ForecastingHorizon([1,2,3], is_relative=True)★fhcan be ints (steps ahead) or an absolute index. Pass it tofitorpredict.f.fit(y, X=X_train, fh=fh); f.predict(X=X_future)Exogenous features viaX— you must supply futureXat predict time.f.update(y_new) · f.predict()Stream new observations without a full refit (where the forecaster supports it).
from sktime.forecasting.arima import AutoARIMA★Auto-tuned (S)ARIMA. AlsoStatsForecastAutoARIMA(the fast Nixtla backend).from sktime.forecasting.exp_smoothing import ExponentialSmoothing from sktime.forecasting.ets import AutoETSHolt-Winters / ETS state-space models.ThetaForecasteris a strong, simple benchmark.from sktime.forecasting.trend import PolynomialTrendForecaster from sktime.forecasting.fbprophet import ProphetTrend models and adapters to Prophet/Darts/statsforecast — all behind the same API.f.get_params() · f.get_fitted_params()Inspect hyperparameters and fitted coefficients (sklearn-style).
f.predict_interval(coverage=0.9)★Prediction intervals at a coverage level — returns lower/upper columns. Not every forecaster supports it.f.predict_quantiles(alpha=[0.1, 0.5, 0.9])Arbitrary quantiles;predict_var()for variance,predict_proba()for a full distribution.f.get_tag("capability:pred_int")Check a forecaster's capability tags before calling interval methods.