Scaling new data to preoject them onto my PCA space

21 ビュー (過去 30 日間)
Rini
Rini 2021 年 4 月 8 日
回答済み: Sai Pavan 2024 年 4 月 19 日
Hello there!
I have a dataset of 30 datasets and around 60 observations. I perform PCA and keep the first two Principal Components, so I project my scores onto them.
Then I try to project a point, that comes from a different PCA analysis onto the axis that I previously created, but am unable to scale it. What is the proper way to tackle this issue?
Thank you in advance!

回答 (1 件)

Sai Pavan
Sai Pavan 2024 年 4 月 19 日
Hello Rini,
I understand that you want to scale new data points to project them onto the PCA space obtained from a different dataset. To project a new point onto the principal component, we need to follow a process that involves scaling the new point according to the original PCA's scaling parameters, and then projecting it using the principal component vectors (eigenvectors) from the original PCA.
Please refer to the below code snippet that illustrates the process:
[coeff, ~, ~, ~, ~, mu] = pca(originalData);
coeff = coeff(:, 1:2); % Keep the first two principal components
stddev = std(originalData); % Calculate standard deviation of the original dataset
newPointStandardized = (newPoint - mu) ./ stddev; % Standardize the new point
newPointProjected = newPointStandardized * coeff; % Project the new point onto the PCA axes
Hope it helps!

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by