collinrooney12 / htsprophet Goto Github PK
View Code? Open in Web Editor NEWHierarchical Time Series Forecasting using Prophet
License: MIT License
Hierarchical Time Series Forecasting using Prophet
License: MIT License
When trying to run the example script I get the following error:
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'
in your post the nodes has this structure :[[3],[2,2,2],[4,4,4,4,4,4]] which is a strict rules
in general we will have bottom layer not same leaf values
like [[3],[2,1,3],[4,1,1,1,1,4]] ?? can this be possible ???
I already generated independent base forecast for each series in the hierarchy, As these base forecasts are independently generated they will not be aggregate consistent" (i.e.,
they will not add up according to the hierarchical structure).I just want to generates a
set of revised forecasts that would aggregate consistently with the hierarchical structure. Can use you py funciton? I looking forward to hearing from u , thanks
d = {'Total': [100],'GP48_1': [100], 'GP48_2': [100]
, 'GP48_1_GP48_cogenpct': [100], 'GP48_1_GP48_coalpct': [100]
, 'GP48_1_GP48_CCpct': [100], 'GP48_2_GP48_windpct': [100]
, 'GP48_2_GP48_biomasspct': [100],'GP48_2_GP48_thermosolarpct': [100]
, 'GP48_2_GP48_PVpct': [100], 'GP48_2_GP48_nuclearpct': [100]
, 'GP48_2_GP48_hydrototalpct': [100]
}
capDataset=pd.DataFrame(d,columns=['Total','GP48_1', 'GP48_2', 'GP48_1_GP48_cogenpct', 'GP48_1_GP48_coalpct',
'GP48_1_GP48_CCpct', 'GP48_2_GP48_windpct', 'GP48_2_GP48_biomasspct', 'GP48_2_GP48_thermosolarpct',
'GP48_2_GP48_PVpct', 'GP48_2_GP48_nuclearpct', 'GP48_2_GP48_hydrototalpct'])
pred = hts(data3, 1, nodes, method = "BU",cap=100,capF=capDataset)
Hi,
Seems to be a bug when running runHTS.py in python 3. There is an issue with holidays producing ValueError: holidays must be a DataFrame with 'ds' and 'holiday' columns, despite it being clearly defined.
Hi Collin, great work, wanted to point out the fit function breaks with our without holidays input with an error related to holidays dataframe.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.