brainspace.gradient.embedding.diffusion_mapping¶
-
brainspace.gradient.embedding.
diffusion_mapping
(adj, n_components=10, alpha=0.5, diffusion_time=0, random_state=None)[source]¶ Compute diffusion map of affinity matrix.
Parameters: - adj (ndarray or sparse matrix, shape = (n, n)) – Affinity matrix.
- n_components (int or None, optional) – Number of eigenvectors. If None, selection of n_components is based
on 95% drop-off in eigenvalues. When n_components is None,
the maximum number of eigenvectors is restricted to
n_components <= sqrt(n)
. Default is 10. - alpha (float, optional) – Anisotropic diffusion parameter,
0 <= alpha <= 1
. Default is 0.5. - diffusion_time (int, optional) – Diffusion time or scale. If
diffusion_time == 0
use multi-scale diffusion maps. Default is 0. - random_state (int or None, optional) – Random state. Default is None.
Returns: - v (ndarray, shape (n, n_components)) – Eigenvectors of the affinity matrix in same order.
- w (ndarray, shape (n_components,)) – Eigenvalues of the affinity matrix in descending order.
References
- Coifman, R.R.; S. Lafon. (2006). “Diffusion maps”. Applied and Computational Harmonic Analysis 21: 5-30. doi:10.1016/j.acha.2006.04.006
- Joseph W.R., Peter E.F., Ann B.L., Chad M.S. Accurate parameter estimation for star formation history in galaxies using SDSS spectra.