Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 18, 2021 08:09
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/2a9be5be9ae6a3c051ad736e3ebd6e59 to your computer and use it in GitHub Desktop.
Save amankharwal/2a9be5be9ae6a3c051ad736e3ebd6e59 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