pyACA: Documentation 0.3.1
Source Code for Audio Content Analysis
Loading...
Searching...
No Matches
Functions
pyACA.ToolPca Namespace Reference

Functions

 ToolPca (V)
 helper function: principal component analysis (pca)
 

Function Documentation

◆ ToolPca()

ToolPca ( V)

helper function: principal component analysis (pca)

Parameters
Vfeatures for all train observations (dimension iNumFeatures x iNumObservations)
Returns
U_pc: transformed features 'score' (dimension see V)
T: transformation matrix 'loading' (dimension iNumFeatures x iNumFeatures )
eigenvalues: 'latent' (length iNumFeatures)

Definition at line 13 of file ToolPca.py.

13def ToolPca(V):
14
15 # covariance
16 cov_VV = np.cov(V)
17
18 # svd
19 [U, eigenvalues, T] = np.linalg.svd(cov_VV)
20
21 # features to components
22 U_pc = np.matmul(T.T, V)
23
24 return U_pc, T, eigenvalues