brainspace.gradient.embedding.DiffusionMaps¶
-
class
brainspace.gradient.embedding.
DiffusionMaps
(n_components=10, alpha=0.5, diffusion_time=0, random_state=None)[source]¶ Diffusion maps.
Parameters: - n_components (int or None, optional) – Number of eigenvectors. 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.
Variables: - lambdas (1D ndarray, shape (n_components,)) – Eigenvalues of the affinity matrix in descending order.
- maps (2D ndarray, shape (n, n_components)) – Eigenvectors of the affinity matrix in same order. Where n is the number of rows of the affinity matrix.
See also
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.
-
__init__
(n_components=10, alpha=0.5, diffusion_time=0, random_state=None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
([n_components, alpha, …])Initialize self. fit
(affinity)Compute the diffusion maps. fit_transform
(x)Compute embedding for x. get_params
([deep])Get parameters for this estimator. set_params
(**params)Set the parameters of this estimator. -
fit
(affinity)[source]¶ Compute the diffusion maps.
Parameters: affinity (ndarray or sparse matrix, shape = (n, n)) – Affinity matrix. Returns: self (object) – Returns self.
-
fit_transform
(x)¶ Compute embedding for x.
Parameters: x (ndarray, shape = (n, n)) – Input matrix. Returns: embedding (ndarray, shape(n, n_components)) – Embedded data.