A scree plot shows cumulative explained variance as principal components are added, helping choose a smaller set without losing most of the dataset’s information. section 3.5.2
Use the plot to:
- Inspect how quickly successive principal components capture variance. section 3.5.2
- Compare the component count with a target level of retained information. section 3.5.2
- Select two components when they retain 95.08% of total variance, as in the Iris workflow. section 3.5.2
Plot cumulative explained variance in Python
After fitting PCA to standardized data, plot np.cumsum(pca.explained_variance_ratio_) against the number of components, label the axes, and use the curve to choose the retained dimensions.

