Changelog¶
All significant changes to this project are documented in this release file.
| Legend | |
|---|---|
| Feature | New feature |
| Enhancement | Improvement in existing functionality |
| API Change | Changes in the API |
| Fix | Bug fix |
0.18.0 Sep 22, 2025¶
The main changes in this release are:
-
Feature New parameter
fold_strideinTimeSeriesFold. This parameter controls how the start of the test set advances between consecutive folds during thebacktesting_forecaster,backtesting_forecaster_multiseriesandbacktesting_sarimaxfunctions. By default,fold_strideis equal tosteps, which means that the test sets do not overlap and there are no gaps between them. However, iffold_strideis set to a value less thansteps, the test sets will overlap, resulting in multiple forecasts for the same observations. Conversely, iffold_strideis set to a value greater thansteps, gaps will be left between consecutive test sets. (#764) -
Feature Added module
drift_detectionwith classRangeDriftDetectorto detect out-of-range values in both target and exogenous variables during prediction. This lightweight detector checks whether new observations fall outside the ranges seen during training, making it suitable for real-time and production environments. It supports both global exogenous variables and series-specific exogenous variables in multiseries forecasting. -
Feature New function
backtesting_gif_creatorin theplotmodule to create a gif that visualizes the backtesting process. -
Feature New function
show_datasets_infoto display information about all available datasets. -
Feature New attribute
__skforecast_tags__and public methodget_tags()in all forecasters which provide metadata about the forecaster, such as its capabilities and limitations. This attribute can be useful for introspection and understanding the behavior of different forecasters. -
API Change Backtesting functions output DataFrame now includes a
foldcolumn to identify the fold number of each prediction. -
Fix Fixed a bug that caused the gap to not be applied correctly in the
backtesting_forecaster_multiseriesfunction. (#1028) -
Fix Fixed a bug that prevented the
CatBoostRegressorfrom working with theForecasterRecursiveMultiSeries. (#1039)
Added
-
New parameter
fold_strideinTimeSeriesFold. This parameter controls how the start of the test set advances between consecutive folds during thebacktesting_forecaster,backtesting_forecaster_multiseriesandbacktesting_sarimaxfunctions. By default,fold_strideis equal tosteps, which means that the test sets do not overlap and there are no gaps between them. However, iffold_strideis set to a value less thansteps, the test sets will overlap, resulting in multiple forecasts for the same observations. Conversely, iffold_strideis set to a value greater thansteps, gaps will be left between consecutive test sets. (#764) -
Added module
drift_detectionwith classRangeDriftDetectorto detect out-of-range values in both target and exogenous variables during prediction. This lightweight detector checks whether new observations fall outside the ranges seen during training, making it suitable for real-time and production environments. It supports both global exogenous variables and series-specific exogenous variables in multiseries forecasting. -
New function
backtesting_gif_creatorin theplotmodule to create a gif that visualizes the backtesting process. -
New function
show_datasets_infoto display information about all available datasets. -
New attribute
__skforecast_tags__and public methodget_tags()in all forecasters which provide metadata about the forecaster, such as its capabilities and limitations. This attribute can be useful for introspection and understanding the behavior of different forecasters.
Changed
- Backtesting functions output DataFrame now includes a
foldcolumn to identify the fold number of each prediction.
Fixed
-
Fixed a bug that caused the gap to not be applied correctly in the
backtesting_forecaster_multiseriesfunction. (#1028) -
Fixed a bug that prevented the
CatBoostRegressorfrom working with theForecasterRecursiveMultiSeries. (#1039)
0.17.0 Aug 11, 2025¶
The main changes in this release are:
-
Feature
ForecasterEquivalentDatecan now predict intervals using the conformal prediction framework. -
Feature Created module
experimental, this module contains experimental features that are not yet fully tested or may change in future releases. -
Enhancement The
ForecasterRNNand the functioncreate_and_compile_modelhave been refactored to allow for the inclusion of exogenous variables. The forecaster can also make interval predictions using the conformal prediction framework. -
API Change Input data passed to all functions/classes must have either a pandas
RangeIndexorDatetimeIndex. Previously, if the input did not meet this condition, aRangeIndexstarting at 0 was automatically generated. This behavior has been removed to ensure consistent and explicit handling of input data. -
API Change
ForecasterRecursiveMultiSeriesnow accepts three input types for theseriesdata: a wide-format DataFrame, where each column corresponds to a different time series; a long-format DataFrame with a MultiIndex, where the first level indicates the series name and the second level is the time index; or a dictionary with series names as keys and pandasSeriesas values. -
API Change
ForecasterRecursiveMultiSeriesnow acceptsexoginput as a wide-format DataFrame, where each column corresponds to a different exogenous variable; a long-format DataFrame with a MultiIndex, where the first level indicates the series name to which it belongs and the second level is the time index; or a dictionary with series names as keys and pandasSeriesorDataFramesas values. -
API Change The functions
series_long_to_dictandexog_long_to_dicthave been renamed toreshape_series_long_to_dictandreshape_exog_long_to_dictin thepreprocessingmodule. -
Fix A bug that prevented the use of
initial_train_sizeas a date with theOneStepAheadFoldduring the hyperparameter search has been fixed. -
Fix A bug that caused the data types to be set incorrectly when creating the predicting matrix with the
create_predict_Xmethod or whenreturn_predictors=Truein thebacktesting_forecasterandbacktesting_forecaster_multiseriesfunctions has been fixed. The dtypes of the predictors are now set to match those of the training data. -
Fix A bug that prevented the use of a
pd.RangeIndexwith theOneStepAheadFoldduring the hyperparameter search has been fixed.
Added
-
Added attribute
exog_dtypes_out_in all forecasters to store the data types of the exogenous variables used in training after the transformation applied bytransformer_exog. Iftransformer_exogis not used, it is equal toexog_dtypes_in_. -
Added function
reshape_series_wide_to_longin thepreprocessingmodule. This function reshapes a wide-format DataFrame where each column corresponds to a series into a long-format DataFrame with with a MultiIndex. The first level of the index is the series name and the second level is the time index. -
Added metric
symmetric_mean_absolute_percentage_errorin themetricsmodule. This metric calculates the symmetric mean absolute percentage error (SMAPE) between the true values and the predicted values. -
ForecasterEquivalentDatecan now predict intervals using the conformal prediction framework. -
Created module
experimental, this module contains experimental features that are not yet fully tested or may change in future releases. -
Include function
calculate_distance_from_holidayin theexperimentalmodule. It calculates the number of days to the next holiday and the number of days since the last holiday in a DataFrame with a date column. -
The
ForecasterRNNand the functioncreate_and_compile_modelnow support the inclusion of exogenous variables. -
Added method
predict_intervalto theForecasterRNNusing the conformal prediction framework.
Changed
-
Input data passed to all functions/classes must have either a pandas
RangeIndexorDatetimeIndex. Previously, if the input did not meet this condition, aRangeIndexstarting at 0 was automatically generated. This behavior has been removed to ensure consistent and explicit handling of input data. -
ForecasterRecursiveMultiSeriesnow accepts three input types for the series data: a wide-format DataFrame, where each column corresponds to a different time series; a long-format DataFrame with a MultiIndex, where the first level indicates the series name and the second level is the time index; or a dictionary with series names as keys and pandas Series as values. -
ForecasterRecursiveMultiSeriesnow acceptsexoginput as a wide-format DataFrame, where each column corresponds to a different exogenous variable; a long-format DataFrame with a MultiIndex, where the first level indicates the series name to which it belongs and the second level is the time index; or a dictionary with series names as keys and pandasSeriesorDataFramesas values. -
When predicting,
ForecasterRecursiveMultiSeriesdoes not require the exog input to have the same type as the one used during training. -
Function
series_long_to_dictrenamed toreshape_series_long_to_dictin thepreprocessingmodule. This function reshapes a long-format DataFrame with time series data into a dictionary format where each entry corresponds to a series. -
Function
exog_long_to_dictrenamed toreshape_exog_long_to_dictin thepreprocessingmodule. This function reshapes a long-format DataFrame with exogenous variables into a dictionary format where each entry corresponds to the exogenous variables of a series. -
The
create_and_compile_modelfunction has been refactored. All arguments related with layers and compilation are now passed as a dictionary using the following arguments:recurrent_layers_kwargs,dense_layers_kwargs,output_dense_layer_kwargs, andcompile_kwargs. -
The arguments
lagsandstepswere removed from theForecasterRNNinitialization. These arguments are now inferred from the regressor architecture. -
Remove
preprocess_y,preprocess_last_windowandpreprocess_exogin favor ofcheck_extract_values_and_indexin theutilsmodule. This function checks if the index is a pandasDatetimeIndexorRangeIndexand extracts the values and index accordingly.
Fixed
-
A bug that prevented the use of
initial_train_sizeas a date with theOneStepAheadFoldduring the hyperparameter search has been fixed. -
A bug that caused the data types to be set incorrectly when creating the predicting matrix with the
create_predict_Xmethod or whenreturn_predictors=Truein thebacktesting_forecasterandbacktesting_forecaster_multiseriesfunctions has been fixed. The dtypes of the predictors are now set to match those of the training data. -
A bug that prevented the use of a
pd.RangeIndexwith theOneStepAheadFoldduring the hyperparameter search has been fixed.
0.16.0 May 01, 2025¶
The main changes in this release are:
- Enhancement Refactored the internal codebase of all forecasters to enhance performance, primarily by replacing pandas DataFrames with more efficient NumPy arrays.
Added
-
Function
set_cpu_gpu_device()in theutilsmodule to set the device of the regressor to 'cpu' or 'gpu'. It is used to ensure that the recursive prediction is done in cpu even if the regressor is set to 'gpu'. This allows to avoid the bottleneck of the recursive prediction when using a gpu. Only applied to recursive forecasters when the regressor is aXGBoost,LightGBMorCatBoostmodel. -
Added
series_name_in_attribute in single series forecasters to store the name of the series used to fit the forecaster. -
Added argument
return_predictorstobacktesting_forecasterandbacktesting_forecaster_multiseriesto return the predictors generated during the backtesting process along with the predictions.
Changed
-
Refactored the internal codebase of all forecasters to enhance performance, primarily by replacing pandas DataFrames with more efficient NumPy arrays.
-
In-sample residuals in direct forecasters has been simplified.
-
The method
create_predict_Xin theForecasterRecursiveMultiSeriesnow returns a long-format DataFrame with the predictors. The columns areleveland one column for each predictor. The index is the same as the prediction index. -
The method
create_predict_Xin theForecasterDirectMultiVariatenow includes thelevelcolumn in the returned DataFrame. The columns areleveland one column for each predictor. The index is the same as the prediction index.
Fixed
0.15.1 Mar 18, 2025¶
- Fix Minor release to fix a bug when importing module
skforecast.sarimax.
Added
Changed
Fixed
- Fixed import error when importing the
skforecast.sarimaxmodule.
0.15.0 Mar 10, 2025¶
The main changes in this release are:
-
Feature Added conformal framework for probabilistic forecasting. Generate prediction intervals using the conformal prediction split method.
-
Feature Binned residuals are now available in the
ForecasterRecursiveMultiSeries,ForecasterDirectandForecasterDirectMultiVariateforecasters. -
Feature New class
ConformalIntervalCalibratorto perform conformal calibration. This class is used to calibrate the prediction intervals using the conformal prediction framework. -
API Change Probabilistic predictions in
ForecasterRecursiveMultiSeriesandForecasterDirectMultiVariateare now returned as a long format DataFrame. -
API Change Fit argument
store_in_sample_residualshas changed default value toFalse. This means in-sample residuals are not stored by default. To store them, call new methodset_in_sample_residualsafter fitting the forecaster using the same training data.
Added
-
Support for
Python 3.13. -
Added
rich>=13.9.4library as hard dependence. -
New argument
method = 'conformal'inpredict_intervalmethod orinterval_method = 'conformal'in backtesting functions to use the conformal prediction framework. -
New class
ConformalIntervalCalibratorto perform conformal calibration. This class is used to calibrate the prediction intervals using the conformal prediction framework. -
Binned residuals are now available in the
ForecasterRecursiveMultiSeries,ForecasterDirectandForecasterDirectMultiVariateforecasters. -
New method
set_in_sample_residualsto store the in-sample residuals after fitting the forecaster using the same training data. -
Functions
crps_from_predictionsandcrps_from_quantilesin modulemetricsto calculate the Continuous Ranked Probability Score (CRPS). -
Function
calculate_coveragein modulemetricsto calculate the coverage of the predicted intervals. -
The
differentiationargument inForecasterRecursiveMultiSeriescan now be a dict to differentiate each series independently. This is useful if the user wants to differentiate each series with a different order or not differentiate some of them. -
Added statistic
ewm(exponential weighted mean) inRollingFeatures. Alpha can be specified using the new argumentkwargs_stats, default{'ewm': {'alpha': 0.3}}. -
Added method
_repr_html_toForecasterSarimax,TimeSeriesFoldandOneStepAheadFoldto display the object in HTML format. -
Added argument
consolidate_dtypesinexog_long_to_dictfunction to ensure that the data types of the exogenous variables are consistent across all series whennp.nanvalues are added and integer columns are converted to float. -
Added
calculate_lag_autocorrelationfunction to theplotmodule to calculate the autocorrelation and partial autocorrelation of a time series. -
Added datasets
m5,ett_m1,ett_m2,ett_m2_extendedandexpenditures_australiaandpublic_transport_madridto thedatasetsmodule. -
Added function
create_mean_pinball_lossin themetricsmodule to create a function to calculate the mean pinball loss for a given quantile. -
Added function
check_one_step_ahead_inputto check the input data when using aOneStepAheadFoldin themodel_selectionfunctions. -
Function
set_warnings_stylein theexceptionsmodule to set the style of the skforecast warnings issued by the library.
Changed
-
ForecasterRecursiveMultiSeriesandForecasterDirectMultiVariateforecasters use conformal prediction framework as default for probabilistic forecasting,method = 'conformal'inpredict_intervalmethod. -
backtesting_forecaster_multiseriesuses conformal prediction framework as default for probabilistic forecasting,interval_method = 'conformal'. -
backtesting_forecasterandbacktesting_forecaster_multiseriesuse binned residuals as default for probabilistic forecasting,use_binned_residuals = True. -
Fit argument
store_in_sample_residualshas changed default value toFalse. This means in-sample residuals are not stored by default. To store them, call new methodset_in_sample_residualsafter fitting the forecaster using the same training data. -
Predictions from
predict_bootstrappinginForecasterRecursiveMultiSeriesandForecasterDirectMultiVariateare now returned as a long format DataFrame with the bootstrapping predictions. The columns arelevel,pred_boot_0,pred_boot_1, ...,pred_boot_n_boot. -
Predictions from
predict_intervalinForecasterRecursiveMultiSeriesandForecasterDirectMultiVariateare now returned as long format DataFrame with the predictions and the lower and upper bounds of the estimated interval. The columns arelevel,pred,lower_bound,upper_bound. -
Predictions from
predict_quantilesinForecasterRecursiveMultiSeriesandForecasterDirectMultiVariateare now returned as long format DataFrame with the quantiles predicted by the forecaster. For example, ifquantiles = [0.05, 0.5, 0.95], the columns arelevel,q_0.05,q_0.5,q_0.95. -
Predictions from
predict_distinForecasterRecursiveMultiSeriesandForecasterDirectMultiVariateare now returned as long format DataFrame with the parameters of the fitted distribution for each step. The columns arelevel,param_0,param_1, ...,param_n, whereparam_iare the parameters of the distribution. -
ForecasterAutoregCustomandForecasterAutoregMultiSeriesCustomhas been deleted (deprecated since skforecast 0.14.0). Window features can be added using thewindow_featuresargument in theForecasterRecursive,ForecasterDirect,ForecasterDirectMultiVariateandForecasterRecursiveMultiSeries. -
Argument
dropnainexog_long_to_dictfunction has been renamed todrop_all_nan_cols. -
Argument
initial_train_sizecan be astror apandas datetimeinTimeSeriesFoldandOneStepAheadFold. If so, the cv object will use the specified date to split the data. (contribution by @g-rubio #898). -
set_dark_themebackground color changed to#001633to improve readability.
Fixed
-
Now
ForecasterRecursiveMultiSeriescan be saved correctly whenweight_funcis adictwithNonefor any series. It now use the method_weight_func_all_1to create the weight function for these series. -
Fix
transform_numpyfunction in theutilsmodule to work when transformers output inscikit-learnisset_output(transform='pandas').
0.14.0 Nov 11, 2024¶
The main changes in this release are:
This release has undergone a major refactoring to improve the performance of the library. Visit the migration guide section for more information.
-
Feature Window features can be added to the training matrix using the
window_featuresargument in all forecasters. You can use theRollingFeaturesclass to create these features or create your own object. Create window and custom features. -
Feature
model_selectionfunctions now have a new argumentcv. This argument expect an object of typeTimeSeriesFold(backtesting) orOneStepAheadFoldwhich allows to define the validation strategy using the argumentsinitial_train_size,steps,gap,refit,fixed_train_size,skip_foldsandallow_incomplete_folds. -
Feature Hyperparameter search now allows to follow a one-step-ahead validation strategy using a
OneStepAheadFoldascvargument in themodel_selectionfunctions. -
Enhancement Refactor the prediction process in
ForecasterRecursiveMultiSeriesto improve performance when predicting multiple series. -
Enhancement The bootstrapping process in the
predict_bootstrappingmethod of all forecasters has been optimized to improve performance. This may result in slightly different results when using the same seed as in previous versions. -
Enhancement Exogenous variables can be added to the training matrix if they do not contain the first window size observations. This is useful when exogenous variables are not available in early historical data. Visit the exogenous variables section for more information.
-
API Change Package structure has been changed to improve code organization. The forecasters have been grouped into the
recursive,directamddeep_learningmodules. Visit the migration guide section for more information. -
API Change
ForecasterAutoregCustomhas been deprecated. Window features can be added using thewindow_featuresargument in theForecasterRecursive. -
API Change Refactor the
set_out_sample_residualsmethod in all forecasters, it now expectsy_trueandy_predas arguments instead ofresiduals. This method is used to store the residuals of the out-of-sample predictions. -
API Change The
pmdarima.ARIMAregressor is no longer supported by theForecasterSarimax. You can use the skforecastSarimaxmodel or, to continue using it, use skforecast 0.13.0 or lower. -
Fix Fixed a bug where the
create_predict_Xmethod in recursive Forecasters did not correctly generate the matrix correctly when using transformations and/or differentiations
Added
-
Added
numba>=0.59as hard dependency. -
Added
window_featuresargument to all forecasters. This argument allows the user to add window features to the training matrix. SeeRollingFeatures. -
Hyperparameter search now allows to follow a one-step-ahead validation strategy using a
OneStepAheadFoldascvargument in themodel_selectionfunctions. -
Differentiation has been extended to all forecasters. The
differentiationargument has been added to all forecasters to model the n-order differentiated time series. -
Create
transform_numpyfunction in theutilsmodule to carry out the transformation of the modeled time series and exogenous variables as numpy arrays. -
random_stateargument in thefitmethod ofForecasterRecursiveto set a seed for the random generator so that the stored sample residuals are always deterministic. -
New private method
_train_test_split_one_step_aheadin all forecasters. -
New private function
_calculate_metrics_one_step_aheadtomodel_selectionmodule to calculate the metrics when predicting one step ahead. -
The
stepsargument in the predict method of theForecasterRecursivecan now be a str or a pandas datetime. If so, the method will predict up to the specified date. (contribution by @imMoya #811). -
Exogenous variables can be added to the training matrix if they do not contain the first window size observations. This is useful when exogenous variables are not available in early historical data.
-
Added support for different activation functions in the
create_and_compile_modelfunction. (contribution by @pablorodriper #824).
Changed
-
ForecasterAutoregCustomandForecasterAutoregMultiSeriesCustomhas been deprecated. Window features can be added using thewindow_featuresargument in theForecasterRecursiveandForecasterRecursiveMultiSeries. -
Refactor
recursive_predictinForecasterRecursiveMultiSeriesto predict all series at once and include option of adding residuals. This improves performance when predicting multiple series. -
Refactor
predict_bootstrappingin all Forecasters. The bootstrapping process has been optimized to improve performance. This may result in slightly different results when using the same seed as in previous versions. -
Change the default value of
encodingtoordinalinForecasterRecursiveMultiSeries. This will avoid conflicts if the regressor does not support categorical variables by default. -
Removed argument
enginefrombayesian_search_forecasterandbayesian_search_forecaster_multiseries. -
The
pmdarima.ARIMAregressor is no longer supported by theForecasterSarimax. You can use the skforecastSarimaxmodel or, to continue using it, use skforecast 0.13.0 or lower. -
initialize_lagsinutilsnow returns the maximum lag,max_lag. -
Removed attribute
window_size_difffrom all Forecasters. The window size extended by the order of differentiation is now calculated onwindow_size. -
lagscan beNonewhen initializing any Forecaster that includes window features. -
model_selectionmodule has been divided internally into different modules to improve code organization (_validation,_search,_split). -
Functions from
model_selection_multiseriesandmodel_selection_sarimaxmodules have been moved to themodel_selectionmodule. -
model_selectionfunctions now have a new argumentcv. This argument expect an object of typeTimeSeriesFoldorOneStepAheadFoldwhich allows to define the validation strategy using the argumentsinitial_train_size,steps,gap,refit,fixed_train_size,skip_foldsandallow_incomplete_folds. -
Added
feature_selectionmodule. The functionsselect_featuresandselect_features_multiserieshave been moved to this module. -
The functions
select_featuresandselect_features_multiseriesnow have 3 returns:selected_lags,selected_window_featuresandselected_exog. -
Refactor the
set_out_sample_residualsmethod in all forecasters, it now expectsy_trueandy_predas arguments instead ofresiduals. -
exog_to_directandexog_to_direct_numpyinutilsnow returns a the names of the columns of the transformed exogenous variables. -
Renamed attributes in all Forecasters:
-
encoding_mappinghas been renamed toencoding_mapping_. -
last_windowhas been renamed tolast_window_. -
index_typehas been renamed toindex_type_. -
index_freqhas been renamed toindex_freq_. -
training_rangehas been renamed totraining_range_. -
series_col_nameshas been renamed toseries_names_in_. -
included_exoghas been renamed toexog_in_. -
exog_typehas been renamed toexog_type_in_. -
exog_dtypeshas been renamed toexog_dtypes_in_. -
exog_col_nameshas been renamed toexog_names_in_. -
series_X_trainhas been renamed toX_train_series_names_in_. -
X_train_col_nameshas been renamed toX_train_features_names_out_. -
binner_intervalshas been renamed tobinner_intervals_. -
in_sample_residualshas been renamed toin_sample_residuals_. -
out_sample_residualshas been renamed toout_sample_residuals_. -
fittedhas been renamed tois_fitted.
-
-
Renamed arguments in different functions and methods:
-
in_sample_residualshas been renamed touse_in_sample_residuals. -
binned_residualshas been renamed touse_binned_residuals. -
series_col_nameshas been renamed toseries_names_in_in thecheck_predict_input,check_preprocess_exog_multiseriesandinitialize_transformer_seriesfunctions in theutilsmodule. -
series_X_trainhas been renamed toX_train_series_names_in_in theprepare_levels_multiseriesfunction in theutilsmodule. -
exog_col_nameshas been renamed toexog_names_in_in thecheck_predict_inputandcheck_preprocess_exog_multiseriesfunctions in theutilsmodule. -
index_typehas been renamed toindex_type_in thecheck_predict_inputfunction in theutilsmodule. -
index_freqhas been renamed toindex_freq_in thecheck_predict_inputfunction in theutilsmodule. -
included_exoghas been renamed toexog_in_in thecheck_predict_inputfunction in theutilsmodule. -
exog_typehas been renamed toexog_type_in_in thecheck_predict_inputfunction in theutilsmodule. -
exog_dtypeshas been renamed toexog_dtypes_in_in thecheck_predict_inputfunction in theutilsmodule. -
fittedhas been renamed tois_fittedin thecheck_predict_inputfunction in theutilsmodule. -
use_in_samplehas been renamed touse_in_sample_residualsin theprepare_residuals_multiseriesfunction in theutilsmodule. -
in_sample_residualshas been renamed touse_in_sample_residualsin thebacktesting_forecaster,backtesting_forecaster_multiseriesandcheck_backtesting_input(utilsmodule) functions.
-
-
binned_residualshas been renamed touse_binned_residualsin thebacktesting_forecasterfunction.-
in_sample_residualshas been renamed toin_sample_residuals_in theprepare_residuals_multiseriesfunction in theutilsmodule. -
out_sample_residualshas been renamed toout_sample_residuals_in theprepare_residuals_multiseriesfunction in theutilsmodule. -
last_windowhas been renamed tolast_window_in thepreprocess_levels_self_last_window_multiseriesfunction in theutilsmodule.
-
Fixed
- Fixed a bug where the
create_predict_Xmethod in recursive Forecasters did not correctly generate the matrix correctly when using transformations and/or differentiations.
0.13.0 Aug 01, 2024¶
The main changes in this release are:
-
Feature Global Forecasters
ForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustomare able to predict series not seen during training. This is useful when the user wants to predict a new series that was not included in the training data. -
Feature
encodingcan be set toNonein Global ForecastersForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustom. This option does not add the encoded series ids to the regressor training matrix. -
Feature New
create_predict_Xmethod in all recursive and direct Forecasters to allow the user to inspect the matrix passed to the predict method of the regressor. -
Feature New module
metricswith functions to calculate metrics for time series forecasting such asmean_absolute_scaled_errorandroot_mean_squared_scaled_error. Visit Time Series Forecasting Metrics for more information. -
Feature New argument
add_aggregated_metricinbacktesting_forecaster_multiseriesto include, in addition to the metrics for each level, the aggregated metric of all levels using the average (arithmetic mean), weighted average (weighted by the number of predicted values of each level) or pooling (the values of all levels are pooled and then the metric is calculated). -
Feature New argument
skip_foldsinmodel_selectionandmodel_selection_multiseriesfunctions. It allows the user to skip some folds during backtesting, which can be useful to speed up the backtesting process and thus the hyperparameter search. -
API Change backtesting procedures now pass the training series to the metric functions so it can be used to calculate metrics that depend on the training series.
-
API Change Changed the default value of the
transformer_seriesargument toNonein the Global ForecastersForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustom. In most cases, tree-based models are used as regressors in these forecasters, so no transformation is applied by default as it is not necessary.
Added
-
Support for
Python 3.12. -
kerashas been added as an optional dependency, tagdeeplearning, to use theForecasterRnn. -
PyTorchbackend for theForecasterRnn. -
New
create_predict_Xmethod in all recursive and direct Forecasters to allow the user to inspect the matrix passed to the predict method of the regressor. -
New
_create_predict_inputsmethod in all Forecasters to unify the inputs of the predict methods. -
New plot function
plot_prediction_intervalsin theplotmodule to plot predicted intervals. -
New module
metricswith functions to calculate metrics for time series forecasting such asmean_absolute_scaled_errorandroot_mean_squared_scaled_error. -
New argument
skip_foldsinmodel_selectionandmodel_selection_multiseriesfunctions. It allows the user to skip some folds during backtesting, which can be useful to speed up the backtesting process and thus the hyperparameter search. -
New function
plot_prediction_intervalsin moduleplot. -
Global Forecasters
ForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustomare able to predict series not seen during training. This is useful when the user wants to predict a new series that was not included in the training data. -
encodingcan be set toNonein Global ForecastersForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustom. This option does not add the encoded series ids to the regressor training matrix. -
New argument
add_aggregated_metricinbacktesting_forecaster_multiseriesto include, in addition to the metrics for each level, the aggregated metric of all levels using the average (arithmetic mean), weighted average (weighted by the number of predicted values of each level) or pooling (the values of all levels are pooled and then the metric is calculated). -
New argument
aggregate_metricingrid_search_forecaster_multiseries,random_search_forecaster_multiseriesandbayesian_search_forecaster_multiseriesto select the aggregation method used to combine the metric(s) of all levels during the hyperparameter search. The available methods are: mean (arithmetic mean), weighted (weighted by the number of predicted values of each level) and pool (the values of all levels are pooled and then the metric is calculated). If more than one metric and/or aggregation method is used, all are reported in the results, but the first of each is used to select the best model. -
New class
DateTimeFeatureTransformerand functioncreate_datetime_featuresin thepreprocessingmodule to create datetime and calendar features from a datetime index.
Changed
-
Deprecated
python 3.8compatibility. -
Update project dependencies.
-
Change default value of
n_binswhen initializingForecasterAutoregfrom 15 to 10. -
Refactor
_recursive_predictin all recursive forecasters. -
Change default value of
transformer_serieswhen initializingForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustomfromStandardScaler()toNone. -
Function
_get_metricmoved frommodel_selectiontometrics. -
Change information message when
verboseisTrueinbacktesting_forecasterandbacktesting_forecaster_multiseries. -
select_n_jobs_backtestingandselect_n_jobs_fitinutilsreturnn_jobs = 1if regressor isLGBMRegressor. This is becauselightgbmis highly optimized for gradient boosting and parallelizes operations at a very fine-grained level, making additional parallelization unnecessary and potentially harmful due to resource contention. -
metric_valuesreturned bybacktesting_forecasterandbacktesting_sarimaxis apandas DataFramewith one column per metric instead of alist.
Fixed
- Bug fix in
backtesting_forecaster_multiseriesusing aForecasterAutoregMultiSeriesorForecasterAutoregMultiSeriesCustomthat includes differentiation.
0.12.1 May 20, 2024¶
Fix This is a minor release to fix a bug.
Added
Changed
Fixed
- Bug fix when storing
last_windowusing a [ForecasterAutoregMultiSeries] that includes differentiation.
0.12.0 May 05, 2024¶
The main changes in this release are:
-
Feature Multiseries forecaster (Global Models) can be trained using series of different lengths and with different exogenous variables per series.
-
Feature New functionality to select features using scikit-learn selectors (
select_featuresandselect_features_multiseries). -
Feature Added new forecaster
ForecasterRnnto create forecasting models based on deep learning (RNN and LSTM). -
Feature New method to predict intervals conditioned on the range of the predicted values. This is can help to improve the interval coverage when the residuals are not homoscedastic (
ForecasterAutoreg). -
Enhancement Bayesian hyperparameter search is now available for all multiseries forecasters using
optunaas the search engine. -
Enhancement All Recursive Forecasters are now able to differentiate the time series before modeling it.
-
API Change Changed the default value of the
transformer_seriesargument to use aStandardScaler()in the Global Forecasters (ForecasterAutoregMultiSeries,ForecasterAutoregMultiSeriesCustomandForecasterAutoregMultiVariate).
Added
-
Added
bayesian_search_forecaster_multiseriesfunction tomodel_selection_multiseriesmodule. This function performs a Bayesian hyperparameter search for theForecasterAutoregMultiSeries,ForecasterAutoregMultiSeriesCustom, andForecasterAutoregMultiVariateusingoptunaas the search engine. -
ForecasterAutoregMultiVariateallows to include None when lags is a dict so that a series does not participate in the construction of X_train. -
The
output_fileargument has been added to the hyperparameter search functions in themodel_selection,model_selection_multiseriesandmodel_selection_sarimaxmodules to save the results of the hyperparameter search in a tab-separated values (TSV) file. -
New argument
binned_residualsin methodpredict_intervalallows to condition the bootstrapped residuals on range of the predicted values. -
Added
save_custom_functionsargument to thesave_forecasterfunction in theutilsmodule. IfTrue, save custom functions used in the forecaster (fun_predictorsandweight_func) as .py files. Custom functions must be available in the environment where the forecaster is loaded. -
Added
select_featuresandselect_features_multiseriesfunctions to themodel_selectionandmodel_selection_multiseriesmodules to perform feature selection using scikit-learn selectors. -
Added
sort_importanceargument toget_feature_importancesmethod in all Forecasters. IfTrue, sort the feature importances in descending order. -
Added
initialize_lags_gridfunction tomodel_selectionmodule. This function initializes the lags to be used in the hyperparameter search functions inmodel_selectionandmodel_selection_multiseries. -
Added
_initialize_levels_model_selection_multiseriesfunction tomodel_selection_multiseriesmodule. This function initializes the levels of the series to be used in the model selection functions. -
Added
set_dark_themefunction to theplotmodule to set a dark theme for matplotlib plots. -
Allow tuple type for
lagsargument in all Forecasters. -
Argument
differentiationin all Forecasters to model the n-order differentiated time series. -
Added
window_size_diffattribute to all Forecasters. It stores the size of the window (window_size) extended by the order of differentiation. Added to all Forecasters for API consistency. -
Added
store_last_windowparameter tofitmethod in Forecasters. IfTrue, store the last window of the training data. -
Added
utils.set_skforecast_warningsfunction to set the warnings of the skforecast package. -
Added new forecaster
ForecasterRnnto create forecasting models based on deep learning (RNN and LSTM). -
Added new function
create_and_compile_modelto moduleskforecast.ForecasterRnn.utilsto help to create and compile a RNN or LSTM models to be used inForecasterRnn.
Changed
-
Deprecated argument
lags_gridinbayesian_search_forecaster. Usesearch_spaceto define the candidate values for the lags. This allows the lags to be optimized along with the other hyperparameters of the regressor in the bayesian search. -
n_bootargument inpredict_intervalchanged from 500 to 250. -
Changed the default value of the
transformer_seriesargument to use aStandardScaler()in the Global Forecasters (ForecasterAutoregMultiSeries,ForecasterAutoregMultiSeriesCustomandForecasterAutoregMultiVariate). -
Refactor
utils.select_n_jobs_backtestingto use the forecaster directly instead offorecaster_nameandregressor_name. -
Remove
_backtesting_forecaster_verbosein model_selection in favor of_create_backtesting_folds, (deprecated since 0.8.0).
Fixed
- Small bug in
utils.select_n_jobs_backtesting, renameForecasterAutoregMultiseriestoForecasterAutoregMultiSeries.
0.11.0 Nov 16, 2023¶
The main changes in this release are:
-
New
predict_quantilesmethod in all Autoreg Forecasters to calculate the specified quantiles for each step. -
Create
ForecasterBaseline.ForecasterEquivalentDate, a Forecaster to create simple model that serves as a basic reference for evaluating the performance of more complex models.
Added
-
Added
skforecast.datasetsmodule. It contains functions to load data for our examples and user guides. -
Added
predict_quantilesmethod to all Autoreg Forecasters. -
Added
SkforecastVersionWarningto theexceptionmodule. This warning notify that the skforecast version installed in the environment differs from the version used to initialize the forecaster when usingload_forecaster. -
Create
ForecasterBaseline.ForecasterEquivalentDate, a Forecaster to create simple model that serves as a basic reference for evaluating the performance of more complex models.
Changed
- Enhance the management of internal copying in skforecast to minimize the number of copies, thereby accelerating data processing.
Fixed
-
Rename
self.skforecast_versionattribute toself.skforecast_versionin all Forecasters. -
Fixed a bug where the
create_train_X_ymethod did not correctly align lags and exogenous variables when the index was not a Pandas index in all Forecasters.
0.10.1 Sep 26, 2023¶
This is a minor release to fix a bug when using grid_search_forecaster, random_search_forecaster or bayesian_search_forecaster with a Forecaster that includes differentiation.
Added
Changed
Fixed
- Bug fix
grid_search_forecaster,random_search_forecasterorbayesian_search_forecasterwith a Forecaster that includes differentiation.
0.10.0 Sep 07, 2023¶
The main changes in this release are:
-
New
Sarimax.Sarimaxmodel. A wrapper ofstatsmodels.SARIMAXthat follows the scikit-learn API and can be used with theForecasterSarimax. -
Added
differentiationargument toForecasterAutoregandForecasterAutoregCustomto model the n-order differentiated time series using the new skforecast preprocessorTimeSeriesDifferentiator.
Added
-
New
Sarimax.Sarimaxmodel. A wrapper ofstatsmodels.SARIMAXthat follows the scikit-learn API. -
Added
skforecast.preprocessing.TimeSeriesDifferentiatorto preprocess time series by differentiating or integrating them (reverse differentiation). -
Added
differentiationargument toForecasterAutoregandForecasterAutoregCustomto model the n-order differentiated time series.
Changed
-
Refactor
ForecasterSarimaxto work with both skforecast Sarimax and pmdarima ARIMA models. -
Replace
setup.pywithpyproject.toml.
Fixed
0.9.1 Jul 14, 2023¶
The main changes in this release are:
- Fix imports in
skforecast.utilsmodule to correctly importsklearn.linear_modelinto theselect_n_jobs_backtestingandselect_n_jobs_fit_forecasterfunctions.
Added
Changed
Fixed
- Fix imports in
skforecast.utilsmodule to correctly importsklearn.linear_modelinto theselect_n_jobs_backtestingandselect_n_jobs_fit_forecasterfunctions.
0.9.0 Jul 09, 2023¶
The main changes in this release are:
-
ForecasterAutoregDirectandForecasterAutoregMultiVariateinclude then_jobsargument in theirfitmethod, allowing multi-process parallelization for improved performance. -
All backtesting and grid search functions have been extended to include the
n_jobsargument, allowing multi-process parallelization for improved performance. -
Argument
refitnow can be also anintegerin all backtesting dependent functions in modulesmodel_selection,model_selection_multiseries, andmodel_selection_sarimax. This allows the Forecaster to be trained every this number of iterations. -
ForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustomcan be trained using series of different lengths. This means that the model can handle datasets with different numbers of data points in each series.
Added
-
Support for
scikit-learn 1.3.x. -
Argument
n_jobs='auto'tofitmethod inForecasterAutoregDirectandForecasterAutoregMultiVariateto allow multi-process parallelization. -
Argument
n_jobs='auto'to all backtesting dependent functions in modulesmodel_selection,model_selection_multiseriesandmodel_selection_sarimaxto allow multi-process parallelization. -
Argument
refitnow can be also anintegerin all backtesting dependent functions in modulesmodel_selection,model_selection_multiseries, andmodel_selection_sarimax. This allows the Forecaster to be trained every this number of iterations. -
ForecasterAutoregMultiSeriesandForecasterAutoregMultiSeriesCustomallow to use series of different lengths for training. -
Added
show_progressto grid search functions. -
Added functions
select_n_jobs_backtestingandselect_n_jobs_fit_forecastertoutilsto select the number of jobs to use during multi-process parallelization.
Changed
-
Remove
get_feature_importancein favor ofget_feature_importancesin all Forecasters, (deprecated since 0.8.0). -
The
model_selection._create_backtesting_foldsfunction now also returns the last window indices and whether or not to train the forecaster. -
The
model_selectionfunctions_backtesting_forecaster_refitand_backtesting_forecaster_no_refithave been unified in_backtesting_forecaster. -
The
model_selection_multiseriesfunctions_backtesting_forecaster_multiseries_refitand_backtesting_forecaster_multiseries_no_refithave been unified in_backtesting_forecaster_multiseries. -
The
model_selection_sarimaxfunctions_backtesting_refit_sarimaxand_backtesting_no_refit_sarimaxhave been unified in_backtesting_sarimax. -
utils.preprocess_yallows a pandas DataFrame as input.
Fixed
-
Ensure reproducibility of Direct Forecasters when using
predict_bootstrapping,predict_distandpredict_intervalwith alistof steps. -
The
create_train_X_ymethod returns a dict of pandas Series asy_traininForecasterAutoregDirectandForecasterAutoregMultiVariate. This ensures that each series has the appropriate index according to the step to be trained. -
The
filter_train_X_y_for_stepmethod inForecasterAutoregDirectandForecasterAutoregMultiVariatenow updates the index ofX_train_stepto ensure correct alignment withy_train_step.
0.8.1 May 27, 2023¶
Added
- Argument
store_in_sample_residuals=Trueinfitmethod added to all forecasters to speed up functions such as backtesting.
Changed
- Refactor
utils.exog_to_directandutils.exog_to_direct_numpyto increase performance.
Fixed
utils.check_exog_dtypesnow compares thedtype.nameinstead of thedtype. (suggested by Metaming https://github.com/Metaming)
0.8.0 May 16, 2023¶
Added
-
Added the
fit_kwargsargument to all forecasters to allow the inclusion of additional keyword arguments passed to the regressor'sfitmethod. -
Added the
set_fit_kwargsmethod to set thefit_kwargsattribute. -
Support for
pandas 2.0.x. -
Added
exceptionsmodule with custom warnings. -
Added function
utils.check_exog_dtypesto issue a warning if exogenous variables are one of typeinit,float, orcategory. Raise Exception ifexoghas categorical columns with non integer values. -
Added function
utils.get_exog_dtypesto get the data types of the exogenous variables included during the training of the forecaster model. -
Added function
utils.cast_exog_dtypesto cast data types of the exogenous variables using a dictionary as a mapping. -
Added function
utils.check_select_fit_kwargsto check if the argumentfit_kwargsis a dictionary and select only the keys used by thefitmethod of the regressor. -
Added function
model_selection._create_backtesting_foldsto provide train/test indices (position) for backtesting functions. -
Added argument
gapto functions inmodel_selection,model_selection_multiseriesandmodel_selection_sarimaxto omit observations between training and prediction. -
Added argument
show_progressto functionsmodel_selection.backtesting_forecaster,model_selection_multiseries.backtesting_forecaster_multiseriesandmodel_selection_sarimax.backtesting_forecaster_sarimaxto indicate weather to show a progress bar. -
Added argument
remove_suffix, defaultFalse, to the methodfilter_train_X_y_for_step()inForecasterAutoregDirectandForecasterAutoregMultiVariate. Ifremove_suffix=Truethe suffix "_step_i" will be removed from the column names of the training matrices.
Changed
-
Rename optional dependency package
statsmodelstosarimax. Now onlypmdarimawill be installed,statsmodelsis no longer needed. -
Rename
get_feature_importance()toget_feature_importances()in all Forecasters.get_feature_importance()method will me removed in skforecast 0.9.0. -
Refactor
get_feature_importances()in all Forecasters. -
Remove
model_selection_statsmodelsin favor ofForecasterSarimaxandmodel_selection_sarimax, (deprecated since 0.7.0). -
Remove attributes
create_predictorsandsource_code_create_predictorsin favor offun_predictorsandsource_code_fun_predictorsinForecasterAutoregCustom, (deprecated since 0.7.0). -
The
utils.check_exogfunction now includes a new optional parameter,allow_nan, that controls whether a warning should be issued if the inputexogcontains NaN values. -
utils.check_exogis applied before and afterexogtransformations. -
The
utils.preprocess_yfunction now includes a new optional parameter,return_values, that controls whether to return a numpy ndarray with the values of y or not. This new option is intended to avoid copying data when it is not necessary. -
The
utils.preprocess_exogfunction now includes a new optional parameter,return_values, that controls whether to return a numpy ndarray with the values of y or not. This new option is intended to avoid copying data when it is not necessary. -
Replaced
tqdm.tqdmbytqdm.auto.tqdm. -
Refactor
utils.exog_to_direct.
Fixed
- The dtypes of exogenous variables are maintained when generating the training matrices with the
create_train_X_ymethod in all the Forecasters.
0.7.0 Mar 21, 2023¶
Added
-
Class
ForecasterAutoregMultiSeriesCustom. -
Class
ForecasterSarimaxandmodel_selection_sarimax(wrapper of pmdarima). -
Method
predict_interval()toForecasterAutoregDirectandForecasterAutoregMultiVariate. -
Method
predict_bootstrapping()to all forecasters, generate multiple forecasting predictions using a bootstrapping process. -
Method
predict_dist()to all forecasters, fit a given probability distribution for each step using a bootstrapping process. -
Function
plot_prediction_distributionin moduleplot. -
Alias
backtesting_forecaster_multivariateforbacktesting_forecaster_multiseriesinmodel_selection_multiseriesmodule. -
Alias
grid_search_forecaster_multivariateforgrid_search_forecaster_multiseriesinmodel_selection_multiseriesmodule. -
Alias
random_search_forecaster_multivariateforrandom_search_forecaster_multiseriesinmodel_selection_multiseriesmodule. -
Attribute
forecaster_idto all Forecasters.
Changed
-
Deprecated
python 3.7compatibility. -
Added
python 3.11compatibility. -
model_selection_statsmodelsis deprecated in favor ofForecasterSarimaxandmodel_selection_sarimax. It will be removed in version 0.8.0. -
Remove
levels_weightsargument ingrid_search_forecaster_multiseriesandrandom_search_forecaster_multiseries, deprecated since version 0.6.0. Useseries_weightsandweights_funcwhen creating the forecaster instead. -
Attributes
create_predictorsandsource_code_create_predictorsrenamed tofun_predictorsandsource_code_fun_predictorsinForecasterAutoregCustom. Old names will be removed in version 0.8.0. -
Remove engine
'skopt'inbayesian_search_forecasterin favor of engine'optuna'. To continue using it, use skforecast 0.6.0. -
in_sample_residualsandout_sample_residualsare stored as numpy ndarrays instead of pandas series. -
In
ForecasterAutoregMultiSeries,set_out_sample_residuals()is now expecting adictfor theresidualsargument instead of apandas DataFrame. -
Remove the
scikit-optimizedependency.
Fixed
-
Remove operator
**inset_params()method for all forecasters. -
Replace
getfullargspecin favor ofinspect.signature(contribution by @jordisilv).
0.6.0 Nov 30, 2022¶
Added
-
Class
ForecasterAutoregMultivariate. -
Function
initialize_lagsinutilsmodule to create lags values in the initialization of forecasters (applies to all forecasters). -
Function
initialize_weightsinutilsmodule to check and initialize argumentsseries_weightsandweight_func(applies to all forecasters). -
Argument
weights_funcin all Forecasters to allow weighted time series forecasting. Individual time based weights can be assigned to each value of the series during the model training. -
Argument
series_weightsinForecasterAutoregMultiSeriesto define individual weights each series. -
Include argument
random_statein all Forecastersset_out_sample_residualsmethods for random sampling with reproducible output. -
In
ForecasterAutoregMultiSeries,predictandpredict_intervalmethods allow the simultaneous prediction of multiple levels. -
backtesting_forecaster_multiseriesallows backtesting multiple levels simultaneously. -
metricargument can be a list ingrid_search_forecaster_multiseries,random_search_forecaster_multiseries. Ifmetricis alist, multiple metrics will be calculated. (suggested by Pablo Dávila Herrero https://github.com/Pablo-Davila) -
Function
multivariate_time_series_corrin moduleutils. -
Function
plot_multivariate_time_series_corrin moduleplot.
Changed
-
ForecasterAutoregDirectallows to predict specific steps. -
Remove
ForecasterAutoregMultiOutputin favor ofForecasterAutoregDirect, (deprecated since 0.5.0). -
Rename function
exog_to_multi_outputtoexog_to_directinutilsmodule. -
In
ForecasterAutoregMultiSeries, rename parameterseries_levelstoseries_col_names. -
In
ForecasterAutoregMultiSerieschange type ofout_sample_residualsto adictof numpy ndarrays. -
In
ForecasterAutoregMultiSeries, delete argumentlevelfrom methodset_out_sample_residuals. -
In
ForecasterAutoregMultiSeries,levelargument ofpredictandpredict_intervalrenamed tolevels. -
In
backtesting_forecaster_multiseries,levelargument ofpredictandpredict_intervalrenamed tolevels. -
In
check_predict_inputfunction, argumentlevelrenamed tolevelsandseries_levelsrenamed toseries_col_names. -
In
backtesting_forecaster_multiseries,metrics_levelsoutput is now a pandas DataFrame. -
In
grid_search_forecaster_multiseriesandrandom_search_forecaster_multiseries, argumentlevels_weightsis deprecated since version 0.6.0, and will be removed in version 0.7.0. Useseries_weightsandweights_funcwhen creating the forecaster instead. -
Refactor
_create_lags_inForecasterAutoreg,ForecasterAutoregDirectandForecasterAutoregMultiSeries. (suggested by Bennett https://github.com/Bennett561) -
Refactor
backtesting_forecasterandbacktesting_forecaster_multiseries. -
In
ForecasterAutoregDirect,filter_train_X_y_for_stepnow starts at 1 (before 0). -
In
ForecasterAutoregDirect, DataFramey_trainnow start with 1,y_step_1(beforey_step_0). -
Remove
cv_forecasterfrom modulemodel_selection.
Fixed
-
In
ForecasterAutoregMultiSeries, argumentlast_windowpredict method now works when it is a pandas DataFrame. -
In
ForecasterAutoregMultiSeries, fix bug transformers initialization.
0.5.1 Oct 05, 2022¶
Added
-
Check that
exogandyhave the same length in_evaluate_grid_hyperparametersandbayesian_search_forecasterto avoid fit exception whenreturn_best. -
Check that
exogandserieshave the same length in_evaluate_grid_hyperparameters_multiseriesto avoid fit exception whenreturn_best.
Changed
- Argument
levels_listingrid_search_forecaster_multiseries,random_search_forecaster_multiseriesand_evaluate_grid_hyperparameters_multiseriesrenamed tolevels.
Fixed
-
ForecasterAutoregMultiOutputupdated to matchForecasterAutoregDirect. -
Fix Exception to raise when
level_weightsdoes not add up to a number close to 1.0 (before was exactly 1.0) ingrid_search_forecaster_multiseries,random_search_forecaster_multiseriesand_evaluate_grid_hyperparameters_multiseries. -
Create_train_X_yinForecasterAutoregMultiSeriesnow works when the forecaster is not fitted.
0.5.0 Sep 23, 2022¶
Added
-
New arguments
transformer_y(transformer_seriesfor multiseries) andtransformer_exogin all forecaster classes. It is for transforming (scaling, max-min, ...) the modeled time series and exogenous variables inside the forecaster. -
Functions in utils
transform_seriesandtransform_dataframeto carry out the transformation of the modeled time series and exogenous variables. -
Functions
_backtesting_forecaster_verbose,random_search_forecaster,_evaluate_grid_hyperparameters,bayesian_search_forecaster,_bayesian_search_optunaand_bayesian_search_skoptin model_selection. -
Created
ForecasterAutoregMultiSeriesclass for modeling multiple time series simultaneously. -
Created module
model_selection_multiseries. Functions:_backtesting_forecaster_multiseries_refit,_backtesting_forecaster_multiseries_no_refit,backtesting_forecaster_multiseries,grid_search_forecaster_multiseries,random_search_forecaster_multiseriesand_evaluate_grid_hyperparameters_multiseries. -
Function
_check_intervalin utils. (suggested by Thomas Karaouzene https://github.com/tkaraouzene) -
metriccan be a list inbacktesting_forecaster,grid_search_forecaster,random_search_forecaster,backtesting_forecaster_multiseries. Ifmetricis alist, multiple metrics will be calculated. (suggested by Pablo Dávila Herrero https://github.com/Pablo-Davila) -
Skforecast works with python 3.10.
-
Functions
save_forecasterandload_forecasterto module utils. -
get_feature_importance()method checks if the forecast is fitted.
Changed
-
backtesting_forecasterchange default value of argumentfixed_train_size: bool=True. -
Remove argument
set_out_sample_residualsin functionbacktesting_forecaster(deprecated since 0.4.2). -
backtesting_forecasterverbose now includes fold size. -
grid_search_forecasterresults include the name of the used metric as column name. -
Remove
get_coefmethod fromForecasterAutoreg,ForecasterAutoregCustomandForecasterAutoregMultiOutput(deprecated since 0.4.3). -
_get_metricnow allowsmean_squared_log_error. -
ForecasterAutoregMultiOutputhas been renamed toForecasterAutoregDirect.ForecasterAutoregMultiOutputwill be removed in version 0.6.0. -
check_predict_inputupdated to checkForecasterAutoregMultiSeriesinputs. -
set_out_sample_residualshas a new argumenttransformto transform the residuals before being stored.
Fixed
-
fitnow storeslast_windowvalues with len = forecaster.max_lag in ForecasterAutoreg and ForecasterAutoregCustom. -
in_sample_residualsstored as apd.Serieswhenlen(residuals) > 1000.
0.4.3 Mar 18, 2022¶
Added
-
Checks if all elements in lags are
intwhen creating ForecasterAutoreg and ForecasterAutoregMultiOutput. -
Add
fixed_train_size: bool=Falseargument tobacktesting_forecasterandbacktesting_sarimax
Changed
-
Rename
get_metricto_get_metric. -
Functions in model_selection module allow custom metrics.
-
Functions in model_selection_statsmodels module allow custom metrics.
-
Change function
set_out_sample_residuals(ForecasterAutoreg and ForecasterAutoregCustom),residualsargument must be apandas Series(wasnumpy ndarray). -
Returned value of backtesting functions (model_selection and model_selection_statsmodels) is now a
float(wasnumpy ndarray). -
get_coefandget_feature_importancemethods unified inget_feature_importance.
Fixed
-
Requirements versions.
-
Method
fitdoesn't removeout_sample_residualseach time the forecaster is fitted. -
Added random seed to residuals downsampling (ForecasterAutoreg and ForecasterAutoregCustom)
0.4.2 Jan 08, 2022¶
Added
-
Increased verbosity of function
backtesting_forecaster(). -
Random state argument in
backtesting_forecaster().
Changed
-
Function
backtesting_forecaster()do not modify the original forecaster. -
Deprecated argument
set_out_sample_residualsin functionbacktesting_forecaster(). -
Function
model_selection.time_series_spliterrenamed tomodel_selection.time_series_splitter
Fixed
- Methods
get_coefandget_feature_importanceofForecasterAutoregMultiOutputclass return proper feature names.
0.4.1 Dec 13, 2021¶
Added
Changed
Fixed
fitandpredicttransform pandas Series and DataFrames to numpy arrays if regressor is XGBoost.
0.4.0 Dec 10, 2021¶
Version 0.4 has undergone a huge code refactoring. Main changes are related to input-output formats (only pandas Series and DataFrames are allowed although internally numpy arrays are used for performance) and model validation methods (unified into backtesting with and without refit).
Added
ForecasterBaseas parent class
Changed
-
Argument
ymust be pandas Series. Numpy ndarrays are not allowed anymore. -
Argument
exogmust be pandas Series or pandas DataFrame. Numpy ndarrays are not allowed anymore. -
Output of
predictis a pandas Series with index according to the steps predicted. -
Scikit-learn pipelines are allowed as regressors.
-
backtesting_forecasterandbacktesting_forecaster_intervalshave been combined in a single function.- It is possible to backtest forecasters already trained.
ForecasterAutoregMultiOutputallows incomplete folds.- It is possible to update
out_sample_residualswith backtesting residuals.
-
cv_forecasterhas the option to updateout_sample_residualswith backtesting residuals. -
backtesting_sarimax_statsmodelsandcv_sarimax_statsmodelshave been combined in a single function. -
gridsearch_forecasteruse backtesting as validation strategy with the option of refit. -
Extended information when printing
Forecasterobject. -
All static methods for checking and preprocessing inputs moved to module utils.
-
Remove deprecated class
ForecasterCustom.
Fixed
0.3.0 Sep 01, 2021¶
Added
-
New module model_selection_statsmodels to cross-validate, backtesting and grid search AutoReg and SARIMAX models from statsmodels library:
backtesting_autoreg_statsmodelscv_autoreg_statsmodelsbacktesting_sarimax_statsmodelscv_sarimax_statsmodelsgrid_search_sarimax_statsmodels
-
Added attribute window_size to
ForecasterAutoregandForecasterAutoregCustom. It is equal tomax_lag.
Changed
cv_forecasterreturns cross-validation metrics and cross-validation predictions.- Added an extra column for each parameter in the dataframe returned by
grid_search_forecaster. - statsmodels 0.12.2 added to requirements
Fixed
0.2.0 Aug 26, 2021¶
Added
-
Multiple exogenous variables can be passed as pandas DataFrame.
-
Documentation at https://skforecast.org
-
New unit test
-
Increased typing
Changed
- New implementation of
ForecasterAutoregMultiOutput. The training process in the new version creates a different X_train for each step. See Direct multi-step forecasting for more details. Old version can be access withskforecast.deprecated.ForecasterAutoregMultiOutput.
Fixed
0.1.9 Jul 27, 2021¶
Added
-
Logging total number of models to fit in
grid_search_forecaster. -
Class
ForecasterAutoregCustom. -
Method
create_train_X_yto facilitate access to the training data matrix created fromyandexog.
Changed
-
New implementation of
ForecasterAutoregMultiOutput. The training process in the new version creates a different X_train for each step. See Direct multi-step forecasting for more details. Old version can be accessed withskforecast.deprecated.ForecasterAutoregMultiOutput. -
Class
ForecasterCustomhas been renamed toForecasterAutoregCustom. However,ForecasterCustomwill still remain to keep backward compatibility. -
Argument
metricincv_forecaster,backtesting_forecaster,grid_search_forecasterandbacktesting_forecaster_intervalschanged from 'neg_mean_squared_error', 'neg_mean_absolute_error', 'neg_mean_absolute_percentage_error' to 'mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error'. -
Check if argument
metricincv_forecaster,backtesting_forecaster,grid_search_forecasterandbacktesting_forecaster_intervalsis one of 'mean_squared_error', 'mean_absolute_error', 'mean_absolute_percentage_error'. -
time_series_spliterdoesn't include the remaining observations in the last complete fold but in a new one whenallow_incomplete_fold=True. Take in consideration that incomplete folds with few observations could overestimate or underestimate the validation metric.
Fixed
- Update lags of
ForecasterAutoregMultiOutputaftergrid_search_forecaster.
0.1.8.1 May 17, 2021¶
Added
set_out_sample_residualsmethod to store or update out of sample residuals used bypredict_interval.
Changed
-
backtesting_forecaster_intervalsandbacktesting_forecasterprint number of steps per fold. -
Only stored up to 1000 residuals.
-
Improved verbose in
backtesting_forecaster_intervals.
Fixed
-
Warning of incomplete folds when using
backtesting_forecastwith aForecasterAutoregMultiOutput. -
ForecasterAutoregMultiOutput.predictallow exog data longer than needed (steps). -
backtesting_forecastprints correctly the number of folds when remainder observations are cero. -
Removed named argument X in
self.regressor.predict(X)to allow using XGBoost regressor. -
Values stored in
self.last_windowwhen trainingForecasterAutoregMultiOutput.
0.1.8 Apr 02, 2021¶
Added
- Class
ForecasterAutoregMultiOutput.py: forecaster with direct multi-step predictions. - Method
ForecasterCustom.predict_intervalandForecasterAutoreg.predict_interval: estimate prediction interval using bootstrapping. skforecast.model_selection.backtesting_forecaster_intervalsperform backtesting and return prediction intervals.
Changed
Fixed
0.1.7 Mar 19, 2021¶
Added
- Class
ForecasterCustom: same functionalities asForecasterAutoregbut allows custom definition of predictors.
Changed
grid_search forecasteradapted to work with objectsForecasterCustomin addition toForecasterAutoreg.
Fixed
0.1.6 Mar 14, 2021¶
Added
- Method
get_feature_importancestoskforecast.ForecasterAutoreg. - Added backtesting strategy in
grid_search_forecaster. - Added
backtesting_forecasttoskforecast.model_selection.
Changed
- Method
create_lagsreturn a matrix where the order of columns match the ascending order of lags. For example, column 0 contains the values of the minimum lag used as predictor. - Renamed argument
Xtolast_windowin methodpredict. - Renamed
ts_cv_forecastertocv_forecaster.
Fixed
0.1.4 Feb 15, 2021¶
Added
- Method
get_coeftoskforecast.ForecasterAutoreg.
Changed
Fixed