mikekeith52 / scalecast

The practitioner's forecasting library
MIT License
332 stars 40 forks source link

Prophet can't be found in grid.py #55

Closed amengjiao closed 1 year ago

amengjiao commented 1 year ago

Hello! I am running this code below from your medium article: https://towardsdatascience.com/introducing-scalecast-a-forecasting-library-pt-1-33b556d9b019

f.set_validation_length(6)

automatically tune and forecast with a series of models

models = ('mlr','knn','svr','xgboost','gbt','elasticnet','mlp', 'arima','prophet' ) for m in models: f.set_estimator(m) f.tune() # by default, will pull grids from Grids.py f.auto_forecast()

I got this error: ModuleNotFoundError: No module named 'prophet'

mikekeith52 commented 1 year ago

Hi!

Try:

pip install prophet

and try again. I don't include prophet as a required library because it has a lot of known installation issues.

amengjiao commented 1 year ago

Thank you so much Mike!

amengjiao commented 1 year ago

Issued solved. Thank you!

amengjiao commented 1 year ago

Hi Michael, could you please help with a further error with prophet? My data has 53 observations. After taking a first order differencing, now there are 52 observations. After I feed the data into the models by running the code below. Everything is good except an error with prophet:

Code:

f.set_validation_length(6) models = ('mlr','knn','svr','xgboost','gbt','elasticnet','mlp', 'arima','prophet') for m in models: f.set_estimator(m) f.tune() # by default, will pull grids from Grids.py f.auto_forecast()

Error:

556 if floor is not None:
557     X["floor"] = floor

--> 558 X["y"] = self.y.to_list() ... 574 "does not match length of index " 575 f"({len(index)})" 576 )

ValueError: Length of values (52) does not match length of index (53)

Do you know what would possibly be the reason for the error?

Thank you so much! Lily

mikekeith52 commented 1 year ago

This looks like a bug. Give me second to look into it.

mikekeith52 commented 1 year ago

I was able to reproduce the error and found the source of the issue. In the next update, this will be fixed. I could probably commit a new version today or tomorrow.

amengjiao commented 1 year ago

Thank you Michael! Appreciate your help!

mikekeith52 commented 1 year ago

Hi, this should be fixed with the new version of scalecast. Please upgrade is you have not already:

pip install --upgrade scalecast

Thanks for raising the issue!