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

runHTS.py does not work #6

Open
XanderHorn opened this issue Mar 29, 2019 · 5 comments
Open

runHTS.py does not work #6

XanderHorn opened this issue Mar 29, 2019 · 5 comments

Comments

@XanderHorn
Copy link

When trying to run the example script I get the following error:

INFO:matplotlib.font_manager:font search path ['/opt/conda/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/ttf', '/opt/conda/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/afm', '/opt/conda/lib/python3.6/site-packages/matplotlib/mpl-data/fonts/pdfcorefonts']
INFO:matplotlib.font_manager:generated new fontManager

TypeError Traceback (most recent call last)
in
44 # NOTE: CVselect takes a while, so if you want results in minutes instead of half-hours pick a different method
45 ##
---> 46 myDict = hts(data2, 52, nodes, holidays = holidays, method = "FP", transform = "BoxCox")
47 ##
48 # This output is a dictionary of dataframes, so you can do any further analysis that you may want. It also allows you to plot the forecasts.

/opt/conda/lib/python3.6/site-packages/htsprophet/hts.py in hts(y, h, nodes, method, freq, transform, include_history, cap, capF, changepoints, n_changepoints, yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples, skipFitting, numThreads)
270 ynew = fitForecast(y, h, sumMat, nodes, method, freq, include_history, cap, capF, changepoints, n_changepoints,
271 yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale, holidays_prior_scale,
--> 272 changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples, boxcoxT, skipFitting)
273 ##
274 # Inverse boxcox the data

/opt/conda/lib/python3.6/site-packages/htsprophet/fitForecast.py in fitForecast(y, h, sumMat, nodes, method, freq, include_history, cap, capF, changepoints, n_changepoints, yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples, boxcoxT, skipFitting)
72 growth = 'linear'
73 m = Prophet(growth, changepoints1, n_changepoints1, yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale,
---> 74 holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples)
75 else:
76 growth = 'logistic'

/opt/conda/lib/python3.6/site-packages/fbprophet/forecaster.py in init(self, growth, changepoints, n_changepoints, changepoint_range, yearly_seasonality, weekly_seasonality, daily_seasonality, holidays, seasonality_mode, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples)
140 self.component_modes = None
141 self.train_holiday_names = None
--> 142 self.validate_inputs()
143
144 def validate_inputs(self):

/opt/conda/lib/python3.6/site-packages/fbprophet/forecaster.py in validate_inputs(self)
147 raise ValueError(
148 "Parameter 'growth' should be 'linear' or 'logistic'.")
--> 149 if ((self.changepoint_range < 0) or (self.changepoint_range > 1)):
150 raise ValueError("Parameter 'changepoint_range' must be in [0, 1]")
151 if self.holidays is not None:

TypeError: '<' not supported between instances of 'str' and 'int'

@shankykm
Copy link

Try the solution in this link. It worked for me.

https://stackoverflow.com/questions/48450418/hts-prophet-holidays-issue/51400527#51400527

@emorfam
Copy link

emorfam commented May 20, 2019

Open PR
#7

@ashish2303
Copy link

i am getting same error while running runHTS.py. "TypeError: '<' not supported between instances of 'str' and 'int'" even though i tried with keyword arguments
detailed error:


TypeError Traceback (most recent call last)
in
----> 1 myDict = hts(data2, 12, nodes, method = "FP")

~\AppData\Local\Continuum\anaconda3\lib\site-packages\htsprophet\hts.py in hts(y, h, nodes, method, freq, transform, include_history, cap, capF, changepoints, n_changepoints, yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples, skipFitting, numThreads)
270 ynew = fitForecast(y, h, sumMat, nodes, method, freq, include_history, cap, capF, changepoints, n_changepoints,
271 yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale, holidays_prior_scale,
--> 272 changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples, boxcoxT, skipFitting)
273 ##
274 # Inverse boxcox the data

~\AppData\Local\Continuum\anaconda3\lib\site-packages\htsprophet\fitForecast.py in fitForecast(y, h, sumMat, nodes, method, freq, include_history, cap, capF, changepoints, n_changepoints, yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples, boxcoxT, skipFitting)
72 growth = 'linear'
73 m = Prophet(growth, changepoints1, n_changepoints1, yearly_seasonality, weekly_seasonality, holidays, seasonality_prior_scale,
---> 74 holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples)
75 else:
76 growth = 'logistic'

~\AppData\Local\Continuum\anaconda3\lib\site-packages\fbprophet\forecaster.py in init(self, growth, changepoints, n_changepoints, changepoint_range, yearly_seasonality, weekly_seasonality, daily_seasonality, holidays, seasonality_mode, seasonality_prior_scale, holidays_prior_scale, changepoint_prior_scale, mcmc_samples, interval_width, uncertainty_samples)
140 self.component_modes = None
141 self.train_holiday_names = None
--> 142 self.validate_inputs()
143
144 def validate_inputs(self):

~\AppData\Local\Continuum\anaconda3\lib\site-packages\fbprophet\forecaster.py in validate_inputs(self)
147 raise ValueError(
148 "Parameter 'growth' should be 'linear' or 'logistic'.")
--> 149 if ((self.changepoint_range < 0) or (self.changepoint_range > 1)):
150 raise ValueError("Parameter 'changepoint_range' must be in [0, 1]")
151 if self.holidays is not None:

TypeError: '<' not supported between instances of 'str' and 'int'

@eoagustin
Copy link

Same. Still not working for me. Already added keyword arguments as mentioned in #7 but still getting the same error.

@amd-wtruong
Copy link

Hi everyone, the solution I found that worked for me was to clone the repo and delete the backslash \ characters. Not sure what \ does in python

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

No branches or pull requests

6 participants