SHARE
TWEET

Untitled

a guest Apr 18th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from sklearn.datasets import load_iris
  2. from sklearn.decomposition import PCA
  3. import matplotlib.pyplot as plt
  4. X = load_iris('data')[0]
  5. p = PCA(n_components=2)
  6. X = p.fit_transform(X)
  7. for i in range(50):
  8.     plt.plot(X[i][0],X[i][1],"o",color = "green")
  9. for i in range(50,100):
  10.     plt.plot(X[i][0],X[i][1],"o",color = "red")
  11. for i in range(100,150):
  12.     plt.plot(X[i][0],X[i][1],"o",color = "blue")
  13. plt.show()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top