mlforecast.auto
lightgbm_space
xgboost_space
catboost_space
linear_regression_space
ridge_space
lasso_space
elastic_net_space
random_forest_space
AutoModel
model
(BaseEstimator): scikit-learn compatible regressorconfig
(callable): function that takes an optuna trial and produces a configuration__init__
AutoLightGBM
__init__
AutoXGBoost
__init__
AutoCatboost
__init__
AutoLinearRegression
__init__
AutoRidge
__init__
AutoLasso
__init__
AutoElasticNet
__init__
AutoRandomForest
__init__
AutoMLForecast
models
(list or dict): Auto models to be optimized.freq
(str or int): pandas’ or polars’ offset alias or integer denoting the frequency of the series.season_length
(int, optional): Length of the seasonal period. This is used for producing the feature space. Only required if init_config
is None. Defaults to None.init_config
(callable, optional): Function that takes an optuna trial and produces a configuration passed to the MLForecast constructor. Defaults to None.fit_config
(callable, optional): Function that takes an optuna trial and produces a configuration passed to the MLForecast fit method. Defaults to None.num_threads
(int): Number of threads to use when computing the features. Defaults to 1.__init__
fit
df
(pandas or polars DataFrame): Series data in long format.n_windows
(int): Number of windows to evaluate.h
(int): Forecast horizon.num_samples
(int): Number of trials to runstep_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.loss
(callable, optional): Function that takes the validation and train dataframes and produces a float. If None
will use the average SMAPE across series. Defaults to None.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’.study_kwargs
(dict, optional): Keyword arguments to be passed to the optuna.Study constructor. Defaults to None.optimize_kwargs
(dict, optional): Keyword arguments to be passed to the optuna.Study.optimize method. Defaults to None.fitted
(bool): Whether to compute the fitted values when retraining the best model. Defaults to False.prediction_intervals
: Configuration to calibrate prediction intervals when retraining the best model.(AutoMLForecast)
: object with best models and optimization resultsforecast_fitted_values
level
(list of ints or floats, optional): Confidence levels between 0 and 100 for prediction intervals. Defaults to None.(pandas or polars DataFrame)
: Dataframe with predictions for the training setpredict
h
(int): Number of periods to predict.X_df
(pandas or polars DataFrame, optional): Dataframe with the future exogenous features. Should have the id column and the time column. Defaults to None.level
(list of ints or floats, optional): Confidence levels between 0 and 100 for prediction intervals. Defaults to None.(pandas or polars DataFrame)
: Predictions for each serie and timestep, with one column per model.save
path
(str or pathlib.Path): Directory where artifacts will be stored.