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

4 次查看(过去 30 天)
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 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