question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Recursion Error (Different from Previous Post)

See original GitHub issue

EDIT: Is this just a version issue? RecursionError was RuntimeError before python 3.5.

I’m working with a large data set (~1,700,000 x ~400), and I’m getting the following error:

Traceback (most recent call last): File "umapping.py", line 25, in <module> u = umap.UMAP(metric="correlation").fit_transform(data) File "/users/nicolerg/anaconda2/lib/python2.7/site-packages/umap/umap_.py", line 1573, in fit_transform self.fit(X) File "/users/nicolerg/anaconda2/lib/python2.7/site-packages/umap/umap_.py", line 1534, in fit self.verbose File "/users/nicolerg/anaconda2/lib/python2.7/site-packages/umap/umap_.py", line 559, in rptree_leaf_array except RecursionError: NameError: global name 'RecursionError' is not defined

This is the relevant bit of code:

data = ps.read_csv(args.input, compression="gzip", header=1, sep=',') nrows = len(data) colors = np.random.rand(nrows, 3) # RGB colors u = umap.UMAP(metric="correlation", n_neighbors=25).fit_transform(data)

I increased n_neighbors from the default of 15 to 25 to see if that would help, but I got the same error. I do not expect that I have equivalent rows in my data. I am trying to cluster the ~1,700,000 instances in ~400 dimensions. Any suggestions?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lmcinnescommented, Jan 26, 2018

I wanted to provide an update on this – I know you have moved on to other issues, but just in case you run into another project where UMAP might be useful…

I believe this issue has finally been resolved. It proved remarkably tricky to get to the bottom of, but was, in the end, a code bug in the SGD optimization of the layout. The latest master branch (v0.2.0+) has a new SGD optimization layout algorithm that does not encounter this issue and should produce much better looking embeddings for large datasets.

0reactions
sleighsoftcommented, Sep 17, 2019

Looks resolved. Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

maximum recursion depth exceeded while calling a Python ...
After a few seconds, I get an error, which is shown below the source code of my function. Code: def MovingTheBall(listOfBalls,position,numCell, ...
Read more >
Python RecursionError: Maximum Recursion Depth Exceeded ...
A Python RecursionError exception is raised when the execution of your program exceeds the recursion limit of the Python interpreter. Two ways ...
Read more >
Python | Handling recursion limit - GeeksforGeeks
When you execute a recursive function in Python on a large input ( > 10^4), you might encounter a “maximum recursion depth exceeded...
Read more >
Appendix A Debugging - Green Tea Press
Most of the time, an infinite recursion will cause the program to run for a while and then produce a “RuntimeError: Maximum recursion...
Read more >
Recursion in Python: An Introduction - Real Python
When you bump up against such a problem, recursion is an indispensable tool for you ... in function [Previous line repeated 996 more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found