Data Science, Python, Programming, Science, Education.
scaler.fit_transform(X) #Step 4: Perform PCA pca = decomposition.PCA() pca.fit(X_scaled) #Step 5: Get the principal components X_pca = pca.transform(X_scaled) R Code # Import data data(iris) # sample data into training and testing 80% and 20% set.seed(111) ind <- sample(2, nrow(iris), replace =