Skip to content

Spectral Embedding#871

Merged
rapids-bot[bot] merged 65 commits intorapidsai:branch-25.08from
aamijar:spectral-embedding
Jul 22, 2025
Merged

Spectral Embedding#871
rapids-bot[bot] merged 65 commits intorapidsai:branch-25.08from
aamijar:spectral-embedding

Conversation

@aamijar
Copy link
Member

@aamijar aamijar commented May 4, 2025

Depends on rapidsai/raft#2662 and Resolves #1025

@copy-pr-bot
Copy link

copy-pr-bot bot commented May 4, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@aamijar aamijar added feature request New feature or request non-breaking Introduces a non-breaking change labels May 4, 2025
@aamijar aamijar self-assigned this May 4, 2025
@cjnolet
Copy link
Member

cjnolet commented Jul 22, 2025

/merge

@rapids-bot rapids-bot bot merged commit 2ca4d3a into rapidsai:branch-25.08 Jul 22, 2025
53 checks passed
rapids-bot bot pushed a commit to rapidsai/cuml that referenced this pull request Jul 25, 2025
Depends on rapidsai/cuvs#871 Resolves #6912

# Benchmarks 1x GH200

|        Dataset        | n_samples | n_features | sklearn_time (s) | cuml_time (s) |   Speedup   |
|-----------------------|-----------|-------------|---------------|-----------|-------------|
| deep-image-96         |   50000   |     96      |    87.027506  |  0.037730 | 2306.607180x |
| fashion-mnist-784     |   50000   |    784      |     2.912207  |  0.053853 |   54.076849x |
| gist-960              |   50000   |    960      |    73.453647  |  0.046808 | 1569.253974x |
| glove-25              |   50000   |     25      |   114.452536  |  0.031595 | 3622.489824x |
| sift-128              |   50000   |    128      |    14.886346  |  0.039108 |  380.651352x |


# Usage
```python
from sklearn import datasets
from cuml.manifold import SpectralEmbedding
import cupy as cp

# (1500, 3) -> (1500, 2)
n_samples = 1500
S_points, S_color = datasets.make_s_curve(n_samples, random_state=0)

spectral = SpectralEmbedding(n_components=2, n_neighbors=None, random_state=42)
embedding = spectral.fit_transform(cp.asarray(S_points, order='C', dtype=cp.float32))


from sklearn.datasets import fetch_openml

# (70000, 784) -> (70000, 2)
mnist = fetch_openml('mnist_784', version=1)
X, y = mnist.data, mnist.target.astype(int)

spectral = SpectralEmbedding(n_components=2, n_neighbors=None, random_state=42)
embedding = spectral.fit_transform(cp.asarray(X, order='C', dtype=cp.float32))
```
![image](https://github.com/user-attachments/assets/ddf8b8e3-dbaf-4932-bb32-b5ada6f935fd)

![image](https://github.com/user-attachments/assets/74ff381b-74f6-419a-9e2f-762bcd7dae6e)

![image](https://github.com/user-attachments/assets/b9fd8df6-af53-4879-ba07-d7fcb46165f8)

Authors:
  - Anupam (https://github.com/aamijar)
  - Jim Crist-Harif (https://github.com/jcrist)

Approvers:
  - Victor Lafargue (https://github.com/viclafargue)
  - Jim Crist-Harif (https://github.com/jcrist)
  - Simon Adorf (https://github.com/csadorf)
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #6581
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CMake cpp feature request New feature or request non-breaking Introduces a non-breaking change

Development

Successfully merging this pull request may close these issues.

[FEA] Spectral Embedding

3 participants