Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Diffusion maps reduce data to coordinates that preserve how points are connected by a similarity graph—not simply how close every pair is in the original feature space. They build a Markov random walk on that graph, then use its leading eigenvectors to summarize the ways probability spreads between points. The result depends on choices such as kernel bandwidth, density normalization, diffusion time, and embedding dimension; there is no universally correct setting.

What a diffusion map represents

Imagine starting a random walk at each data point. After a chosen number of steps, the walk has a probability distribution over the graph. Two points are close in diffusion distance when their walks produce similar distributions, even if the points are not close in the raw feature space. Multiple paths through the graph contribute to this comparison, so a short chain of locally similar observations can connect points that are far apart by direct feature-space distance.

A diffusion map compresses these transition profiles into a small set of Euclidean coordinates. Its geometry therefore describes graph connectivity at a selected scale. It is useful when observations lie near a lower-dimensional nonlinear structure, or when connectivity and gradual transitions matter more than preserving every original pairwise distance.

This is different from PCA, which finds directions of greatest linear variance, and from methods that primarily preserve selected pairwise distances. Diffusion maps begin with a graph and a walk; the kernel, graph construction, normalization, and walk time all help define what “near” means.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

How the construction works

  1. Build similarities. Treat observations as graph nodes and assign larger nonnegative weights to similar pairs. A common choice is the Gaussian kernel W[i,j] = exp(-||x[i]-x[j]||² / epsilon). Here epsilon is a squared-distance scale: increasing it generally broadens neighborhoods.
  2. Correct for local sampling density, if desired. Let q[i] be the sum of row i of W. A density correction with exponent alpha forms W_alpha[i,j] = W[i,j] / (q[i]^alpha q[j]^alpha). This is a modeling choice, not merely a numerical adjustment.
  3. Turn weights into transition probabilities. Divide each row of the corrected kernel by its row sum. The resulting row-stochastic matrix P gives the one-step transition probabilities of a random walk.
  4. Extract coordinates. Compute leading eigenpairs of P. The stationary, constant-like eigenvector ordinarily does not distinguish observations, so coordinates use leading nontrivial eigenvectors. Diffusion time t weights each eigenvector by lambda^t.

For a symmetric affinity kernel and symmetric density correction, the row-normalized transition matrix is generally not symmetric. A symmetric matrix similar to it can be diagonalized instead, then its eigenvectors can be converted back to right eigenvectors of P. The implementation below uses that approach.

Choose the modeling settings for the question

Kernel and neighborhood scale

The bandwidth determines which observations exchange probability directly. If it is too narrow, the graph may fragment into disconnected pieces; if it is too broad, local structure can be blurred by long-range connections. A full Gaussian kernel connects every pair mathematically, but weights can become so small that the effective graph is poorly connected. A sparse neighborhood graph reduces storage and computation, but its neighbor rule and symmetrization also affect connectivity.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Inspect graph components or connectivity, and examine how the leading eigenvalues and embedding change across plausible scales. If the result changes drastically after a modest bandwidth adjustment, treat that instability as a modeling finding rather than hiding it behind one selected value. Distances also depend on feature scaling: standardize or otherwise scale features only when that scaling matches their meaning in the problem.

Density normalization

Nonuniform sampling can influence the walk: densely sampled regions collect more kernel mass. In the manifold-sampling analysis, the conventional alpha = 1 correction is used to target Laplace–Beltrami, or heat-operator, geometry independently of nonuniform sampling density, under the analysis assumptions. With no correction (alpha = 0), sampling density remains part of the operator’s behavior. Other normalizations can represent other operators or retain density and potential effects. Choose normalization according to whether density is nuisance variation or meaningful signal; do not assume one setting is correct for every data-generating process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Normalization choice Interpretation to consider Use when
alpha = 0 No kernel-density correction; sampling density influences the walk. The distinct operator limits for normalizations are discussed by Nadler et al. (2006). Density or density-related dynamics should remain part of the geometry.
alpha = 1 in the conventional construction Targets Laplace–Beltrami geometry independently of nonuniform sampling density in the manifold-sampling analysis; assumptions matter (Nadler et al., 2006). The goal is manifold geometry less affected by uneven sampling.

Diffusion time and dimension

Time changes which spectral modes matter. Raising eigenvalues to t suppresses modes with smaller magnitude more strongly as t grows, so longer times emphasize persistent connectivity and coarser structure. At short times, more local distinctions can remain visible. Compare embeddings at times relevant to the phenomenon rather than treating a time value as an incidental default.

Retain enough nontrivial eigenvectors to represent the structures needed for the task, then assess the result in that task. Eigenvalue decay can help describe the spectrum, but the foundational sources do not establish a universal cutoff or a single dimension-selection rule.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A dense reference implementation in Python

This implementation takes a numeric feature matrix, constructs the Gaussian kernel and density correction, and returns coordinates plus the nontrivial eigenvalues. It uses alpha = 1 as an explicit choice for a density-independent manifold-geometry target, not as a universal default. Pass an epsilon appropriate to the scaled features and data; the code does not select one automatically.

import numpy as np
from scipy.linalg import eigh


def diffusion_map(X, epsilon, n_components=2, alpha=1.0, t=1):
    """Dense diffusion map for a small or moderate data set.

    X: array of shape (n_samples, n_features)
    epsilon: positive squared-distance bandwidth for exp(-distance_squared / epsilon)
    n_components: number of nontrivial coordinates to return
    alpha: kernel-density normalization exponent
    t: nonnegative integer diffusion time
    """
    X = np.asarray(X, dtype=float)
    if X.ndim != 2 or X.shape[0] < 2:
        raise ValueError("X must be a 2D array with at least two rows")
    if not np.isfinite(X).all():
        raise ValueError("X must contain only finite values")
    if epsilon <= 0:
        raise ValueError("epsilon must be positive")
    if n_components < 1 or n_components >= X.shape[0]:
        raise ValueError("n_components must be between 1 and n_samples - 1")
    if int(t) != t or t < 0:
        raise ValueError("t must be a nonnegative integer")

    # Pairwise squared Euclidean distances; clamp roundoff below zero.
    norms = np.sum(X * X, axis=1)
    dist2 = norms[:, None] + norms[None, :] - 2.0 * X @ X.T
    np.maximum(dist2, 0.0, out=dist2)

    W = np.exp(-dist2 / epsilon)
    q = W.sum(axis=1)
    W_alpha = W / (q[:, None] ** alpha * q[None, :] ** alpha)
    d = W_alpha.sum(axis=1)

    # S is symmetric and similar to the row-stochastic transition matrix P.
    S = W_alpha / np.sqrt(d[:, None] * d[None, :])
    eigenvalues, eigenvectors = eigh(S)
    order = np.argsort(eigenvalues)[::-1]
    eigenvalues = eigenvalues[order]
    eigenvectors = eigenvectors[:, order]

    # Convert S eigenvectors to right eigenvectors of P = D^-1 W_alpha.
    psi = eigenvectors / np.sqrt(d[:, None])
    lambdas = eigenvalues[1:n_components + 1]
    coordinates = psi[:, 1:n_components + 1] * (lambdas ** t)[None, :]
    return coordinates, lambdas

Example call: coordinates, eigenvalues = diffusion_map(X, epsilon=1.0, n_components=3, alpha=1.0, t=2). The example’s epsilon is illustrative only; it is not a recommended value for arbitrary data. Eigenvector signs are arbitrary, so a coordinate axis may flip sign across implementations without changing the represented geometry.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

What this code does not scale to

The reference implementation stores a dense pairwise distance matrix and dense kernels, requiring quadratic memory in the number of observations; its dense eigendecomposition is also costly as the data set grows. For larger data, construct a sparse neighborhood graph, maintain symmetry as required by the chosen construction, and use a sparse eigensolver for leading eigenpairs. A surfaced Python package describes sparse linear algebra and optional GPU acceleration, but its current maintenance and compatibility were not established, so verify its present state and dependencies before relying on it.

Validate the embedding against the data and task

  • Check graph connectivity. Look for isolated observations or disconnected components; a narrow kernel or restrictive neighbor graph can split the data.
  • Compare plausible settings. Examine whether important neighborhoods, transitions, or clusters persist across reasonable bandwidths, normalization choices, and diffusion times.
  • Use an external task criterion where possible. If coordinates feed a prediction, clustering, or visualization task, assess them against that task rather than selecting dimension solely by appearance.
  • Interpret the scale correctly. Distances in the embedding summarize the selected graph walk and time, not a promise to preserve all raw-space distances.

Foundational sources

  • Ronald R. Coifman and Stéphane Lafon, “Diffusion maps,” Applied and Computational Harmonic Analysis, 21(1), 5–30 (July 2006). Introduces the framework, diffusion coordinates, and the family of diffusion distances.
  • Boaz Nadler, Stéphane Lafon, Ronald R. Coifman, and Ioannis G. Kevrekidis, “Diffusion maps, spectral clustering and reaction coordinates of dynamical systems,” Applied and Computational Harmonic Analysis, 21(1), 113–127 (July 2006). Analyzes normalization choices and continuum differential-operator limits.
  • Boaz Nadler, Stéphane Lafon, Ioannis G. Kevrekidis, and Ronald R. Coifman, “Diffusion Maps, Spectral Clustering and Eigenfunctions of Fokker-Planck Operators,” NeurIPS 2005. Develops diffusion-distance interpretation and a low-dimensional approximation result under a specified mean-squared-error criterion.
  • Coifman et al., “Geometric diffusions as a tool for harmonic analysis and structure definition of data: diffusion maps,” PNAS (2005), a complementary multiscale account.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.