Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created February 3, 2021 16:46
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/f93379237071a7d41b61537c475f3513 to your computer and use it in GitHub Desktop.
Save amankharwal/f93379237071a7d41b61537c475f3513 to your computer and use it in GitHub Desktop.
# reduce the dimensionality of the dataset
pca = PCA(n_components=2)
x_principal = pca.fit_transform(x_normal)
x_principal = pd.DataFrame(x_principal)
x_principal.columns = ['V1', 'V2']
print(x_principal.head())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment