scanpy.Neighbors.compute_eigen#
- Neighbors.compute_eigen(*, n_comps=15, sort='decrease', rng, sym=None)[source]#
Compute eigen decomposition of transition matrix.
- Parameters:
- n_comps
int(default:15) Number of eigenvalues/vectors to be computed, set
n_comps = 0if you need all eigenvectors.- rng
Generator Random number generation to control stochasticity.
If a type:
SeedLikevalue, it’s used to seed a new random number generator; If anumpy.random.Generator,rng’s state will be directly advanced; IfNone, a non-reproducible random number generator is used. Seenumpy.random.default_rng()for more details.The default value matches legacy scanpy behavior and will change to
Nonein scanpy 2.0.
- n_comps
- Return type:
- Returns:
Writes the following attributes.
- eigen_values
ndarray Eigenvalues of transition matrix.
- eigen_basis
ndarray Matrix of eigenvectors (stored in columns).
.eigen_basisis projection of data matrix on right eigenvectors, that is, the projection on the diffusion components. these are simply the components of the right eigenvectors and can directly be used for plotting.
- eigen_values