Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in model_utils.get_s_x_extrapolate() - input with gaps at the beginning #201

Closed
capelastegui opened this issue Mar 23, 2021 · 2 comments · Fixed by #205
Closed

Error in model_utils.get_s_x_extrapolate() - input with gaps at the beginning #201

capelastegui opened this issue Mar 23, 2021 · 2 comments · Fixed by #205
Labels
bug Something isn't working

Comments

@capelastegui
Copy link
Contributor

There is a bug related to model_naive, introduced in v0.2.0

  File "/virtual3.8/lib/python3.8/site-packages/anticipy/forecast.py", line 928, in run_forecast
    return run_forecast_single(df_y,
  File "/python3.8/site-packages/anticipy/forecast.py", line 1370, in run_forecast_single
    df_data_tmp = extrapolate_model(
  File "/virtual3.8/lib/python3.8/site-packages/anticipy/forecast.py", line 720, in extrapolate_model
    s_y_forecast = pd.Series(data=a_y_forecast, index=s_x.index, name='y')
  File "/virtual3.8/lib/python3.8/site-packages/pandas/core/series.py", line 313, in __init__
    raise ValueError(
ValueError: Length of passed values is 522, index implies 261.

It looks similar to #199

@capelastegui capelastegui added the bug Something isn't working label Mar 23, 2021
@capelastegui
Copy link
Contributor Author

capelastegui commented Mar 23, 2021

Problem is related to:

  • model_naive()
  • where df_actuals has samples with weight 0, at the beginning.

I think model_utils.get_normalized_x_from_date() has problems with null values

In run_forecast_single(), we pass df_actuals_interpolated rather than df_actuals to fit_model() and extrapolate_model(). We may be missing interactions between the interpolation logic and 0-weight samples in our unit tests

@capelastegui capelastegui changed the title Problems with model_naive Error in model_utils.get_s_x_extrapolate() - input with gaps at the beginning Mar 24, 2021
@capelastegui
Copy link
Contributor Author

capelastegui commented Mar 24, 2021

Fixed on the dev branch, need to prepare a bugfix release

capelastegui added a commit that referenced this issue May 28, 2021
* bug #201; Error in model_utils.get_s_x_extrapolate()

* Release v0.2.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant