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

4 Ansichten (letzte 30 Tage)
Chanille
Chanille am 17 Feb. 2023
Beantwortet: the cyclist am 18 Feb. 2023
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

Akzeptierte Antwort

the cyclist
the cyclist am 18 Feb. 2023
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.

Weitere Antworten (0)

Kategorien

Mehr zu Dimensionality Reduction and Feature Extraction finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by