anticipy icon indicating copy to clipboard operation
anticipy copied to clipboard

Forecast works on 0.1.8 level but breaks at the 0.2.1 level

Open GREENENVIRON123 opened this issue 2 years ago • 2 comments

Issue: With the included Storage_Utilization.csv series daily data points I ran the below forecast. This works fine at the 0.1.8 level but at the 0.2.1 level the forecast skips the week 1 of Actual data and starts the forecast at week 2., thereby producing a forecast that is 7 days short.

Observations: (1) A "snaive_wday" is chosen as the model (2) The input data ideally should have included the whole month of October 2023 but is missing the last week of October. At the 0.1.8. level this worked fine.

#See Attached files here:

#Input Series Storage_Utilization.csv

#Resulting Forecast Forecasted_DF.csv

                   #CODE Follows:

                   #Convert  Storage_Utilization.csv to Pandas Dataframe, name it pdf and ingest
                   #Forecast / extrapolate_years "fut" variable resolves to 182 days

                    get_forecast  =  forecast.run_forecast(pdf, extrapolate_years=fut, simplify_output=True, include_all_fits=False,      \
                                   find_outliers=False, l_model_trend = [forecast_models.model_linear, forecast_models.model_constant,  \
                                   forecast_models.model_exp, forecast_models.model_step, forecast_models.model_quasilinear],             \
                                   l_model_season = [forecast_models.model_null])

                    antlgh = len(get_forecast)
                    print("Forecast DF Length: " + str(antlgh))

                    #Output Forecasted_DF.csv for debugging
                    fct       = specify.output_path +  "Forecasted_DF" +  ".csv"
                    get_forecast.to_csv(fct, index=False)

GREENENVIRON123 avatar Oct 26 '23 14:10 GREENENVIRON123

I think that's just how the snaive_wday model works - it copies the weekly samples from the previous week, so it has nothing for week 1. The model behaviour has not changed between 0.1.8 and 0.2.1, but model selection has - you probably were getting a plain naive model with the previous version. You can disable naive models altogether by passing l_model_naive=[], and see how non-naive models perform in that scenario (probably not great). If you see other models missing samples like this, then that is a bug that we need to address.

capelastegui avatar Oct 27 '23 09:10 capelastegui

OK I will disable the snaive model as suggested and give it a go.Thanks Again.Sent from my T-Mobile 4G LTE Device -------- Original message --------From: Pedro Capelastegui @.> Date: 10/27/23 5:16 AM (GMT-05:00) To: sky-uk/anticipy @.> Cc: GREENENVIRON123 @.>, Author @.> Subject: Re: [sky-uk/anticipy] Forecast works on 0.1.8 level but breaks at the 0.2.1 level (Issue #210) I think that's just how the snaive_wday model works - it copies the weekly samples from the previous week, so it has nothing for week 1. The model behaviour has not changed between 0.1.8 and 0.2.1, but model selection has - you probably were getting a plain naive model with the previous version. You can disable naive models altogether by passing l_model_naive=[], and see how non-naive models perform in that scenario (probably not great). If you see other models missing samples like this, then that is a bug that we need to address.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

GREENENVIRON123 avatar Oct 27 '23 10:10 GREENENVIRON123