Skip to content

Instantly share code, notes, and snippets.

@EdMan1022
Created August 11, 2017 20:06
Show Gist options
  • Save EdMan1022/ab416aa45cf546647345e21311276be1 to your computer and use it in GitHub Desktop.
Save EdMan1022/ab416aa45cf546647345e21311276be1 to your computer and use it in GitHub Desktop.
sklearn pca example
from sklearn import decomposition
import numpy as np
pca = decomposition.PCA(n_components=2)
X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
x = pca.fit_transform(X)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment