Scaling new data to preoject them onto my PCA space
조회 수: 22 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
답변 (1개)
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!
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!