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

ValueError on make_future_dataframe #344

Closed
matsuobasho opened this issue May 15, 2024 · 3 comments
Closed

ValueError on make_future_dataframe #344

matsuobasho opened this issue May 15, 2024 · 3 comments
Labels

Comments

@matsuobasho
Copy link

What happened + What you expected to happen

Trying to run fcst.make_future_dataframe and getting valuerror.
ValueError: starts must be integers or timestamps, got '<class 'pandas._libs.tslibs.timestamps.Timestamp'>'.

Versions / Dependencies

pandas 2.2.2
mlforecast 0.12.1

Reproduction script

fcst = MLForecast(
    models=lgb.LGBMRegressor(n_jobs=1, random_state=0, verbosity=-1),
    freq='15min',
    lags=[1,2,3,4,5,6,7,8],   # last 2 hours
    lag_transforms={
       1: [ExpandingStd()],
       360: [RollingMean(window_size=14)],
    },
    date_features=['hour', 'dayofweek', 'month'],
)

fcst.fit(train)

fcst.make_future_dataframe(10)

I discovered this while trying to run fcst.predict and getting the same error there.
I can't share the train code, but the ds field is a datetime64[ns, US/Eastern], whereas in the tutorials I see that it's just `datetime64[ns]'.

Could that be the issue?

Btw, I tried to go to the Slack to ask this question (to avoid opening issue), but not able to login with my Google account.

Issue Severity

Medium: It is a significant difficulty but I can work around it.

@jmoralez
Copy link
Member

Hey @matsuobasho, thanks for raising this. This should be fixed by Nixtla/utilsforecast#84, which is part of the 0.1.10 release, can you try upgrading to that version (pip install -U utilsforecast)?

@matsuobasho
Copy link
Author

Thanks for the response @jmoralez . That worked! Is this a recent change? If not, might want to update which version of utilsforecast is installed, since I had just run pip install mlforecast to install about a month ago.

@jmoralez
Copy link
Member

Yes, I just fixed it. I'll bump the utilsforecast version in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants