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

Recursion Error #44

Open
ghost opened this issue Oct 1, 2020 · 2 comments
Open

Recursion Error #44

ghost opened this issue Oct 1, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Oct 1, 2020

I cannot run more than two levels in local machine using Jupyter notebook.
hierarchy = {**total, **state_h} --> works
hierarchy = {**total, **state_h, **store_h} ---> fails with below error

print(sys.getrecursionlimit())
3000


RecursionError Traceback (most recent call last)
in
3 df = df.resample("W").sum()
4 clf = HTSRegressor(model='prophet', revision_method='OLS', n_jobs=12)
----> 5 model = clf.fit(df, hierarchy)
6
7 preds = model.predict(steps_ahead=1)

~\Anaconda3\lib\site-packages\hts\core\regressor.py in fit(self, df, nodes, tree, exogenous, root, distributor, disable_progressbar, show_warnings, **fit_kwargs)
194 """
195
--> 196 self.__init_hts(nodes=nodes, df=df, tree=tree, root=root, exogenous=exogenous)
197
198 nodes = make_iterable(self.nodes, prop=None)

~\Anaconda3\lib\site-packages\hts\core\regressor.py in __init_hts(self, nodes, df, tree, root, exogenous)
131 self.nodes = tree
132 else:
--> 133 self.nodes = HierarchyTree.from_nodes(nodes=nodes, df=df, exogenous=exogenous, root=root)
134 self.exogenous = exogenous
135 self.sum_mat = to_sum_mat(self.nodes)

~\Anaconda3\lib\site-packages\hts\hierarchy_init_.py in from_nodes(cls, nodes, df, exogenous, root, top, stack)
176 root=tmp_root,
177 top=top,
--> 178 stack=stack) # pass tmp_root to the function as root
179 return top
180

... last 1 frames repeated, from the frame below ...

~\Anaconda3\lib\site-packages\hts\hierarchy_init_.py in from_nodes(cls, nodes, df, exogenous, root, top, stack)
176 root=tmp_root,
177 top=top,
--> 178 stack=stack) # pass tmp_root to the function as root
179 return top
180

RecursionError: maximum recursion depth exceeded while calling a Python object

@ghost ghost added the bug Something isn't working label Oct 1, 2020
@carlomazzaferro
Copy link
Owner

Would you be able to post sample data for the example you're running? I'd like to reproduce locally to further debug

@aakashparsi
Copy link
Collaborator

aakashparsi commented Jun 29, 2021

@selenonel, I have faced a similar issue but increasing the recursion limit solved the problem. Now, I'm wondering is that a good practice to do? I think @carlomazzaferro may have an answer to this.

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

No branches or pull requests

2 participants