why use np.max instead of np.min in smooth_knn_dist
See original GitHub issuethought it should be nearest neighbor which has mininum
distance?
https://github.com/lmcinnes/umap/blob/master/umap/umap_.py#L179
rho[i] = np.max(non_zero_dists)
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
numpy max vs amax vs maximum - Stack Overflow
maximum can only be used element-wise, while numpy.max and numpy.amax can be used on particular axes, or all elements. Why is there more...
Read more >How to use the NumPy max function - Sharp Sight
The numpy.max() function computes the maximum value of the numeric values contained in a NumPy array. It can also compute the maximum value...
Read more >Max & Min of NumPy Array in Python (3 Examples)
In this example, I'll illustrate how to get the minima and maxima of all values in a NumPy array. To calculate the maximum...
Read more >Aggregations: Min, Max, and Everything In Between
For min , max , sum , and several other NumPy aggregates, a shorter syntax is to use methods of the array object...
Read more >NumPy's max() and maximum(): Find Extreme Values in Arrays
In this tutorial, you'll learn how to: Use the NumPy max() function; Use the NumPy maximum() function and understand why it's different from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The way it’s currently done in UMAP is the symmetrized normalized Laplacian (L_sym in the notation used by von Luxburg in that tutorial). For that, you need the
dim + 1
smallest eigenvectors, ignoring the smallest eigenvector.You could instead use the random walk transition matrix, P, in which case you would want the
dim + 1
largest eigenvectors, ignoring the top eigenvector. Those are the equivalent to thedim + 1
bottom eigenvectors of the random walk Laplacian, L_rw (once again ignoring the bottom eigenvector). That’s basically the same procedure as Laplacian Eigenmaps.In the tutorial, on various theoretical grounds, von Luxburg suggests that L_rw is superior to L_sym for spectral clustering. But I’ve not noticed that one is superior to the other for the purposes of initializing UMAP.
It depends on the choice of Laplacian (there are several) and a few other things. I got some advice from some experts in the area and went with that. I did recently get some alternative approaches suggested from another expert in spectral methods on graphs, but haven’t had time to explore them yet.