mlforecast.optimization
mlforecast_objective
df
(DataFrame): Series data in long format.config_fn
(callable): Function that takes an optuna trial and produces a configuration with the following keys:
loss
(callable): Function that takes the validation and train dataframes and produces a float.model
(BaseEstimator): scikit-learn compatible model to be trainedfreq
(str or int): 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
(int, optional): Step size between each cross validation window. If None it will be equal to h
. Defaults to None.input_size
(int, optional): Maximum training samples per serie in each window. If None, will use an expanding window. Defaults to None.refit
(bool or int): 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. Defaults to False.id_col
(str): Column that identifies each serie. Defaults to ‘unique_id’.time_col
(str): Column that identifies each timestep, its values can be timestamps or integers. Defaults to ‘ds’.target_col
(str): Column that contains the target. Defaults to ‘y’.(Callable[[optuna.Trial], float])
: optuna objective function