Scaling new data to preoject them onto my PCA space

조회 수: 22 (최근 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 CenterFile Exchange에서 Dimensionality 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