Skip to content

Spectral Embedding #6581

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

Draft
wants to merge 20 commits into
base: branch-25.08
Choose a base branch
from
Draft

Conversation

aamijar
Copy link
Member

@aamijar aamijar commented Apr 24, 2025

Resolves #6912

Benchmarks

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

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

image

Copy link

copy-pr-bot bot commented Apr 24, 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.

@github-actions github-actions bot added Cython / Python Cython or Python issue CMake CUDA/C++ labels Apr 24, 2025
@aamijar aamijar added non-breaking Non-breaking change feature request New feature or request labels Apr 24, 2025
@aamijar aamijar self-assigned this Apr 24, 2025
Copy link
Member

@cjnolet cjnolet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in review

Copy link

copy-pr-bot bot commented May 4, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@aamijar aamijar force-pushed the spectral-embedding branch from 073a7a5 to 09b724c Compare May 5, 2025 23:57
@aamijar aamijar changed the base branch from branch-25.06 to branch-25.08 June 16, 2025 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake CUDA/C++ Cython / Python Cython or Python issue feature request New feature or request non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Spectral Embedding Python API
2 participants