How could I graph the percent of variance by PC component?

4 ビュー (過去 30 日間)
Chanille
Chanille 2023 年 2 月 17 日
回答済み: the cyclist 2023 年 2 月 18 日
I am trying to replicate these graphs with my own data but the pca function doesn't give this graphs explicitly. Do I have to extract these numbers from the code and plot them elsewhere? (explained vs. pc) If so, would I just plot explained vs. pc (is that the simplest way to do it? anD THE SIMPLEST WAY TO plot the scores vs. each pC? I am sure there's a quick fix but I wanted to make sure i had different options. Thanks

採用された回答

the cyclist
the cyclist 2023 年 2 月 18 日
You are correct that the pca function does not have an option to plot directly, and you do need to take the output and then plot it.
You are also correct that to get a scree plot like the one you attached, the easiest way is just plot the explained output from pca.
To get the other graph, that you included as an image, you probably want to use the histogram function on the score output. If you want three sets of axes in one figure, as shown, then I'd suggest the tiledlayout function.

その他の回答 (0 件)

カテゴリ

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