, , - python numpy ( " " matlab - python numpy, , "" pythonic [the'course matlab):
import numpy as np
def _cas(D):
"""Center at mean and standardize."""
return (D- D.mean(1)[:, None])/ (D.shape[1]- 1)** .5
def example(D):
"""Eigenvalues and -vectors, based on SVD."""
u, s, v= np.linalg.svd(D, full_matrices= False);
return np.diag(s)** 2, u
if __name__ == '__main__':
data= np.random.rand(5, 20)
data= _cas(data)
eigenvals, eigenvecs= example(data)
print eigenvals
print eigenvecs
?
, ? FTIW , (500, 20000) example(.) 20 .
(- ) , 2,5 ( 10- )! , , , , , "" data!
? -vectors? .. ?