spine.math.decomposition

Numba JIT compiled implementation of decomposition routines.

Functions

principal_components(x)

Computes the principal components of a point cloud by computing the eigenvectors of the centered covariance matrix.

Classes

PCA(*args, **kwargs)

Class-version of the Numba-accelerate principal_components() function.

class spine.math.decomposition.PCA(*args, **kwargs)[source]

Class-version of the Numba-accelerate principal_components() function.

n_components

Number of PCA components

Type:

int

components

(N_c, D) List of principal axes

Type:

np.ndarray

explained_variance

(N_c) Variance along each of the principal axes

Type:

np.ndarray

Methods

fit(x)

Computes the covariance and eigen-decompose the data.

class_type

class_type = jitclass.PCA#7dd0941c7350<n_components:int64>
spine.math.decomposition.principal_components(x: ndarray) ndarray[source]

Computes the principal components of a point cloud by computing the eigenvectors of the centered covariance matrix.

Parameters:

x (np.ndarray) – (N, d) Coordinates in d dimensions

Returns:

(d, d) List of principal components (row-ordered)

Return type:

np.ndarray