Problem 2: Scale Data Before Applying PCA
Easypython
Problem Description
Write a Python program that scales a dataset using StandardScaler before applying PCA, demonstrating the correct preprocessing order.
Input
A dataset with features of different scales.
Output
The PCA-transformed data, using properly scaled input.
Constraints
- At least 5 data rows.
Example Input
text(A dataset with features like age and salary, of very different scales)
Example Output
text(PCA-transformed data based on properly scaled features)
Concepts Covered
StandardScaler, PCA, correct preprocessing order.