Skip to content

Instantly share code, notes, and snippets.

View RyotaBannai's full-sized avatar
🛴
Man's soil is still rich enough to direct his own life.

Ryota Bannai RyotaBannai

🛴
Man's soil is still rich enough to direct his own life.
View GitHub Profile
from numpy import linalg as LA
w, v = LA.eig(C)
idx = w.argsort()[::-1] # In order that bigger Eigenvalue comes first
w, v = w[idx], v[:, idx]
X -= X.mean(axis=0)
C = np.cov(X,rowvar=False)
import numpy as np
X = np.random.rand(5,10)