Skip to content

[QUESTION] Cannot replicate 2nd iteration results of my historical_forecasts() using predict() #2938

@lubibi13

Description

@lubibi13

I have this LinearRegression model.

model_tsmx_luz_temp = LinearRegressionModel(lags=[-1,-2,-3,-4,-5,-6,-7,-14,-21,-30,-60,-90,-120,-150,-180,-210,-240,-365],
output_chunk_length=365,
multi_models=False,
random_state=43)

-- temp_max_ser_luz ranges from 2021-01-01 to 2025-10-22

hfc_params_mult_luz = {
"series": temp_max_ser_luz,
"forecast_horizon": 365,
"verbose": True,
"retrain": True,
}

historical_fcasts_mult_luz = model_tsmx_luz_temp.historical_forecasts(last_points_only=False, stride=3, **hfc_params_mult_luz)

-- len(historical_fcasts_mult_luz) == 99

Using the predict method(), I was able to replicate the same results as in historical_fcasts_mult_luz[0]:

Image

I reinstantiated model_tsmx_luz_temp again...

model_tsmx_luz_temp.fit(samp_temp_exa)
pred_tsmx_luz_temp = model_tsmx_luz_temp.predict(365)

Image Image

THIS TIME, i tried to replicate historical_fcasts_mult_luz[1]:

I extended my training data (samp_temp_exa) by 3 days to simulate stride=3 in my historical_forecasts.
Image

I reinstantiated model_tsmx_luz_temp again...

model_tsmx_luz_temp.fit(samp_temp_exa)
pred_tsmx_luz_temp = model_tsmx_luz_temp.predict(365)

Image Image

As you can see, I cannot replicate historical_fcasts_mult_luz[1] which is the 2nd iteration result of my historical_forecasts. How did this happen??

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedtriageIssue waiting for triaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions