Clear Filters
Clear Filters

Do predictive variables need to be standardised before applying PCA in classification learner?

19 views (last 30 days)
Hi,
I have a feature table and I'm looking to apply PCA in classification learner. Do I need to first standardise my feature table before I import the data into classification learner to apply PCA and train models?
Reason I ask is that if I want to perform PCA e.g. in the live editor, it is usually recommended to standardise data using the zscore function and then apply PCA to generate pareto, biplots etc. However, the classification learner doesn't seem to do this. Additionally, when I look at the fisheriris dataset examples in the help files, it looks like the data is not standardised before being imported to the classification learner (https://uk.mathworks.com/help/stats/feature-selection-and-feature-transformation.html).
Any guidance will be really appreciated!

Accepted Answer

Taylor
Taylor on 16 Apr 2024 at 16:04
Yes, it is generally recommended to standardize data before applying PCA, especially when the variables in your dataset are measured on different scales or have different units of measurement.
Standardization transforms the data to have a mean of zero and a standard deviation of one. This process ensures that each variable contributes equally to the analysis and prevents variables with larger scales from dominating the variance explained by the principal components.
Skipping the step of standardization when applying PCA might be appropriate or necessary in certain contexts. In the case of the fisheriris dataset, it is because the data has homogeneous units and scales. If all variables in your dataset are measured in the same units and have approximately the same scale and variance, standardization might not be necessary. In such cases, the original scales of the variables are meaningful, and preserving these scales might be important for interpretation. For example, if all variables are measurements of length in centimeters, standardizing would remove this common scale, potentially making the results less interpretable.
  2 Comments
Impala
Impala on 16 Apr 2024 at 21:07
Hi Taylor,
Thank you for your explanation. So if I standardise my feature table using zscore, and create a new feature table, say called featTable_stand - is that the table I then use in classification learner to train models?
Thank you!

Sign in to comment.

More Answers (0)

Products


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!