{"id":22374,"library":"skforecast","title":"Skforecast","description":"Skforecast is a Python library for time series forecasting using statistical and machine learning models. It works with any estimator compatible with the scikit-learn API, including LightGBM, XGBoost, CatBoost, Keras, and many others. Current version is 0.22.0, with a release cadence of roughly quarterly.","status":"active","version":"0.22.0","language":"python","source_language":"en","source_url":"https://github.com/skforecast/skforecast","tags":["time-series","forecasting","sklearn","machine-learning","grid-search"],"install":[{"cmd":"pip install skforecast","lang":"bash","label":"PyPI install"}],"dependencies":[{"reason":"Core dependency for base estimators and utilities.","package":"scikit-learn","optional":false},{"reason":"Array and numerical operations.","package":"numpy","optional":false},{"reason":"Data manipulation and time series handling.","package":"pandas","optional":false},{"reason":"Caching and parallel processing.","package":"joblib","optional":false},{"reason":"Just-in-time compilation for performance.","package":"numba","optional":false},{"reason":"Optional hyperparameter tuning.","package":"optuna","optional":true},{"reason":"Optional booster.","package":"xgboost","optional":true},{"reason":"Optional booster.","package":"lightgbm","optional":true},{"reason":"Optional booster.","package":"catboost","optional":true}],"imports":[{"note":"Module structure changed in v0.9.0; old import path no longer works.","wrong":"from skforecast.ForecasterAutoreg import ...","symbol":"ForecasterAutoreg","correct":"from skforecast.recursive import ForecasterAutoreg"},{"note":"Direct forecaster moved to separate module.","wrong":"from skforecast.ForecasterAutoregDirect import ...","symbol":"ForecasterAutoregDirect","correct":"from skforecast.direct import ForecasterAutoregDirect"},{"note":"","wrong":"","symbol":"ForecasterAutoregCustom","correct":"from skforecast.recursive import ForecasterAutoregCustom"},{"note":"Introduced in v0.12.0.","wrong":"","symbol":"ForecasterAutoregMultiOutput","correct":"from skforecast.recursive import ForecasterAutoregMultiOutput"},{"note":"","wrong":"","symbol":"ForecasterSARIMAX","correct":"from skforecast.sarimax import ForecasterSARIMAX"},{"note":"Renamed in v0.22.0; old import removed.","wrong":"from skforecast.model_selection_grid_search import ...","symbol":"BacktestGridSearch","correct":"from skforecast.model_selection import BacktestGridSearch"},{"note":"","wrong":"","symbol":"BacktestRandomSearch","correct":"from skforecast.model_selection import BacktestRandomSearch"},{"note":"Moved to preprocessing module in v0.21.0.","wrong":"from skforecast.utils import TimeSeriesDifferentiator","symbol":"TimeSeriesDifferentiator","correct":"from skforecast.preprocessing import TimeSeriesDifferentiator"}],"quickstart":{"code":"import numpy as np\nimport pandas as pd\nfrom skforecast.recursive import ForecasterAutoreg\nfrom sklearn.ensemble import RandomForestRegressor\n\n# Example data\ny = pd.Series(np.random.rand(100), index=pd.date_range(start='2020-01-01', periods=100, freq='D'))\n\n# Create forecaster\nforecaster = ForecasterAutoreg(\n    regressor=RandomForestRegressor(random_state=123),\n    lags=10\n)\n\n# Fit\nforecaster.fit(y=y)\n\n# Predict\npredictions = forecaster.predict(steps=5)\nprint(predictions.head())","lang":"python","description":"Basic usage: create a ForecasterAutoreg with a random forest regressor and 10 lags, fit on a univariate series, and predict 5 steps ahead."},"warnings":[{"fix":"Replace `from skforecast.model_selection import grid_search_forecaster` with `from skforecast.model_selection import BacktestGridSearch` and adjust usage.","message":"In v0.22.0, model_selection module was reorganized. Functions like `grid_search_forecaster` and `random_search_forecaster` are removed. Use `BacktestGridSearch` and `BacktestRandomSearch` instead.","severity":"breaking","affected_versions":">=0.22.0"},{"fix":"Change import to `from skforecast.preprocessing import TimeSeriesDifferentiator`.","message":"In v0.21.0, `TimeSeriesDifferentiator` moved from `skforecast.utils` to `skforecast.preprocessing`. Old import will raise ImportError.","severity":"breaking","affected_versions":">=0.21.0"},{"fix":"Use `ForecasterAutoregMultiOutput` with steps parameter.","message":"`ForecasterAutoregDirect` is deprecated in favor of `ForecasterAutoregMultiOutput` since v0.12.0.","severity":"deprecated","affected_versions":">=0.12.0"},{"fix":"Ensure function returns array with correct dimensions; test with a small dataset first.","message":"When using `ForecasterAutoregCustom`, the custom `create_lags` function must return a numpy array of shape (len(y), len(lags)). Wrong shape leads to silent errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Always convert to pd.Series: `y = pd.Series(y_array)`.","message":"`ForecasterAutoreg.fit()` expects `y` as a pandas Series. Passing a numpy array or DataFrame with multiple columns will raise ValueError.","severity":"gotcha","affected_versions":"all"},{"fix":"Remove `selector_step` and pass `feature_selection=True` to `fit()`.","message":"`ForecasterAutoreg` parameter `selector_step` is deprecated since v0.18.0. Use `feature_selection` argument in `fit()` instead.","severity":"deprecated","affected_versions":">=0.18.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from skforecast.model_selection import BacktestGridSearch` instead. See docs: https://skforecast.org/0.22.0/api/model_selection","cause":"In v0.22.0, the model_selection module was refactored; `grid_search_forecaster` function was removed.","error":"ImportError: cannot import name 'grid_search_forecaster' from 'skforecast.model_selection'"},{"fix":"Ensure `create_lags` returns a NumPy array of shape (n_samples, n_lags).","cause":"When using `ForecasterAutoregCustom`, the custom `create_lags` function returns an array with wrong shape (e.g., one column instead of multiple lags).","error":"ValueError: The length of the values (1) does not match the length of the index (100)"},{"fix":"Use `forecaster.predict(steps=5, interval=True)`.","cause":"`predict_interval` was removed in v0.22.0; interval prediction is now done via `predict` with `interval=True`.","error":"AttributeError: 'ForecasterAutoreg' object has no attribute 'predict_interval'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}