Hi! I want to know where the fit function is done ...
# general
m
Hi! I want to know where the fit function is done in cross-validation? maybe if I want to change the optimization function for training. Here is my implementation part: " models = [ADIDA(), IMAPA(), CrostonClassic(), CrostonSBA(), CrostonOptimized(), TSB(alpha_d=0.5, alpha_p=0.5)] fcst = StatsForecast(df=df_to_process, models=models, freq='W-MON', n_jobs=-1) crossvalidation_df = fcst.cross_validation( df = df_to_process, h = 8, step_size = 1, n_windows = 7, sort_df=True ) "
m
Hi @Maria! To optimize speed, the cross-validation method does not have a fit predict architecture. However, if you are interested in the in-sample predictions, you can use the
StatsForecast.cross_validation_fitted_values
method.
Copy code
After executing StatsForecast.cross_validation, you can access the insample prediction values for each model and window. To get them, you need to pass fitted=True to the StatsForecast.cross_validation method and then use the StatsForecast.cross_validation_fitted_values method.
Ref: https://nixtla.github.io/statsforecast/core.html#statsforecast.cross_validation
🙌 1
m
Thank you, @Max (Nixtla)!