Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 20, 2021 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/daae85161c7150c9da07f5ab4396224b to your computer and use it in GitHub Desktop.
Save amankharwal/daae85161c7150c9da07f5ab4396224b to your computer and use it in GitHub Desktop.
import numpy as np
np.random.seed(4)
m = 60
w1, w2 = 0.1, 0.3
noise = 0.1
angles = np.random.rand(m) * 3 * np.pi / 2 - 0.5
X = np.empty((m, 3))
from sklearn.decomposition import PCA
pca = PCA(n_components = 2)
X2D = pca.fit_transform(X)
print(X2D)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment