Skip to content

Instantly share code, notes, and snippets.

@RyotaBannai
Last active December 19, 2018 16:24
Show Gist options
  • Save RyotaBannai/728f0d55ea737a77b009c4393d797dbc to your computer and use it in GitHub Desktop.
Save RyotaBannai/728f0d55ea737a77b009c4393d797dbc to your computer and use it in GitHub Desktop.
rng = np.random.RandomState(1)
X_raw = np.dot(rng.rand(2, 2), rng.randn(2, 200)).T
X_mean = X_raw.mean(axis=0)
X -= X_mean
U, s, Vt = LA.svd(X, full_matrices=False)
V = Vt.T
S = np.diag(s)
e_values = (s ** 2) / X.shape[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment