Bug: NaN result with projection to 1D latent space
See original GitHub issueHi,
thanks for publishing and maintaining this cool project! I played around with UMAP a bit and encountered an oddity: I have a small (n=178) distance matrix that I want to project onto a 1D space. If I run UMAP in version 0.3.0 with the default parameters, sometimes the resulting low-dimensional data consists of NaN
s exclusively while sometimes the result seems perfectly fine.
I narrowed it down to the random_state
being used, which seems a bit fishy. To reproduce: I call
res = umap.UMAP(
n_components=1,
random_state=8,
metric='precomputed'
).fit_transform(high_dim_data)
print(numpy.count_nonzero(numpy.isnan(res)))
where high_dim_data
is as defined in https://gist.github.com/rmitsch/cd99fcacf6a8f3c0d41af6f903735251.
I didn’t observe this behaviour with n_components
> 1, but haven’t checked thoroughly yet. I just tried various values for random_state
until I could reproduce the NaN
result.
Is this a known problem? I couldn’t find any related issues.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:12 (7 by maintainers)
Top GitHub Comments
I wanted to verify this fixes the issue for others before releasing an update to PyPI (which should be on version 0.3.2 by now anyway – note that you need umap-learn on PyPI). Will try to get an update rolled out soon. Thanks for the feedback and the reproducer everytone – it helped a lot.
On Fri, Aug 17, 2018 at 8:43 AM Raphael Mitsch notifications@github.com wrote:
Fine suggestion. I set a loop running until I got a failure, which is now reproducible with that seed. I’ll try to dig into this soon and see what the actual underlying issues is. Thanks!