필터 지우기
필터 지우기

How to find relative loading factors on the primary principal component?

조회 수: 2 (최근 30일)
New Innovations
New Innovations 2017년 10월 17일
답변: Vatsal 2024년 6월 13일
I have a set of color images sized 600*600.I extracted 16 color channels from each image and changed each channel into column matrix sized 360000*1 and concatenated each 16 channels to form 360000*16 matrix.Now I want to implement PCA on it to identify the most discriminative channel.Implemented code is given below:
Xi=[Rcol,Gcol,Bcol,Hcol,Scol,Vcol,Ycol,Icol,Qcol,L1col,acol,bcol,M1col,M21col,M3col,M61col];
avg=mean(Xi);
sd=std(Xi,0,1);
Xnorm=bsxfun(@minus,Xi,avg);
Xnorm = bsxfun(@rdivide,Xnorm,sd);
Xi1=cov(Xnorm);
[V, D]=eig(Xi1);
In implementing paper they say to analyze the relative loading factor of different color channels on the primary principal component.So can you tell me how to calculate loading factor on primary principal component using matlab?

답변 (1개)

Vatsal
Vatsal 2024년 6월 13일
Hi,
The loading factors are the coefficients of the principal components, indicating the contribution of each variable to that principal component. Given that you have computed the eigenvectors (V) and eigenvalues (D) from the covariance matrix of the normalized data, the next steps involve identifying the primary principal component and extracting its loadings.The primary principal component is associated with the largest eigenvalue. Since MATLAB returns the eigenvalues in ascending order in 'D', the last column of 'V' corresponds to the primary principal component.The eigenvector associated with the largest eigenvalue (i.e., the primary principal component) contains the loadings for each variable on this component.
Here is the implementation:
% Assuming V and D are already computed as per your code
% Find the index of the largest eigenvalue
[~, largestEigIndex] = max(diag(D));
% Extract the eigenvector (loadings) corresponding to the largest eigenvalue
primaryPC = V(:, largestEigIndex);
% Display the loadings
disp('Loadings on the primary principal component:');
disp(primaryPC);
I hope this 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