Local
Optimization
source
mlforecast_objective
optuna objective function for the MLForecast class
Type | Default | Details | |
---|---|---|---|
df | Union | ||
config_fn | Callable | Function that takes an optuna trial and produces a configuration with the following keys: - model_params - mlf_init_params - mlf_fit_params | |
loss | Callable | Function that takes the validation and train dataframes and produces a float. | |
model | BaseEstimator | scikit-learn compatible model to be trained | |
freq | Union | pandas’ or polars’ offset alias or integer denoting the frequency of the series. | |
n_windows | int | Number of windows to evaluate. | |
h | int | Forecast horizon. | |
step_size | Optional | None | Step size between each cross validation window. If None it will be equal to h . |
input_size | Optional | None | Maximum training samples per serie in each window. If None, will use an expanding window. |
refit | Union | False | Retrain model for each cross validation window. If False, the models are trained at the beginning and then used to predict each window. If positive int, the models are retrained every refit windows. |
id_col | str | unique_id | Column that identifies each serie. |
time_col | str | ds | Column that identifies each timestep, its values can be timestamps or integers. |
target_col | str | y | Column that contains the target. |
Returns | Callable |
SMAPE | MASE | OWA | |
---|---|---|---|
Weekly | 9.261538 | 2.614473 | 0.976158 |