- Data Preprocessing: Ensure that your data matrix X is correctly formatted as n-by-p.
- Function Call: Verify that you are calling the pca function correctly and not using any additional arguments that might alter the output.
Doubt regarding the dimension of coeff in pca function
1 view (last 30 days)
Show older comments
Under the description of the function 'pca', it is given that the coeff=pca(X) returns a coeff matrix of p by p matrix if the data matrix X is n by p.
*[coeff = pca(X) returns the principal component coefficients, also known as loadings, for the n-by-p data matrix X. Rows of X correspond to observations and columns correspond to variables. The coefficient matrix is p-by-p.]
However, when I checked with my data I'm getting the coeff dimension as same as data matrix. I also checked by assigning the data matrix using **random numbers. The coeff values will values be p by p ? Could anyone please explain?
========== *Taken from Matlan Tutorial **Obtained by using rand function in Matlab ==========
0 Comments
Answers (1)
arushi
on 30 Jul 2024
Hi Shehz,
If you are seeing different dimensions, consider examining the follwoing potential issues:
Hope this helps.
0 Comments
See Also
Categories
Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!