AI, Dimensionality Reduction, Machine Learning, Python, Data Science.
X_train_pca = pca.fit_transform(X_train_std) X_test_pca = pca.transform(X_test_std) # Display the results print("Original Training Data Shape:", X_train.shape) print("Reduced Training Data Shape (PCA):", X_train_pca.shape) print("Number of Components Selected:", n_components) In this example, the