Materials and data ·

What does PCA actually show?

A materials dataset can contain composition, temperature, density, grain size and several measured properties. How can we see its main patterns without plotting every possible pair?

Principal component analysis, usually shortened to PCA, provides one useful view. It finds directions along which the data vary most. It does not tell us why that variation occurred.

Start with a cloud of points

Imagine that each point represents one specimen. Its horizontal position is one measured quantity and its vertical position is another. A long, narrow cloud suggests that the two quantities change together. PCA identifies the direction along the length of that cloud as the first principal component. The second principal component is perpendicular to it.

The directions pass through the mean of the data. Before finding them, we subtract the mean of each quantity. This operation is called centering. A principal component is a combination of the original quantities, rather than a new measurement made on the specimen.

Rotate the data and change its spread

The example below uses synthetic, centered descriptors with no physical units. Rotate the cloud, then increase its transverse spread. The points stay the same between changes, so you can isolate the effect of each control.

Explore PCA

Orange: first principal direction. Teal: second principal direction. The axis lengths show the relative standard deviations.

What does “explained variance” mean?

Variance measures the spread of a quantity about its mean. PCA assigns a variance to each principal direction. The explained-variance fraction is that direction's variance divided by the total variance. It tells us how much of the spread that projection retains.

When the cloud is narrow, projecting onto the first direction preserves most of its variation. When the cloud becomes circular, the two variances become equal. There is then no unique preferred direction. Small changes in the observations can rotate the reported principal directions substantially.

Units affect the answer

Suppose the two axes are temperature in kelvin and grain size in micrometers. Their numerical ranges can differ greatly. Changing micrometers to meters changes those numerical values and can change PCA performed directly on them.

One option is to standardize each quantity: subtract its mean, then divide by its standard deviation. The resulting values are dimensionless. This gives each quantity unit variance, but it also changes the question. We are now comparing relative variation rather than the original magnitudes. Standardization is a modeling choice, not an automatic correction that is always appropriate.

A pattern is a starting point

A strong principal direction might arise because processing changes several properties together. It might also reflect two different material families mixed in one dataset. PCA alone cannot establish a physical mechanism or a cause.

I would inspect the original quantities, color the observations by a known material family, and check whether the same pattern remains within each family. If prediction is the goal, a direction with small variance may still contain information needed to predict the property of interest. Keeping only the largest components can discard that information.

SVD, explained with a small picture introduces the calculation used in the next tutorial.

Next step: Work through PCA with small pixel images. The tutorial includes code cells, image reconstruction and worked self-checks.

How the interactive example is calculated

The points lie on a sampled ellipse. Its long-axis scale is 1 and its transverse scale is the selected value. The two-dimensional covariance matrix is calculated from the centered points. Its eigenvalues give the component variances. The eigenvectors give their directions. At equal eigenvalues, the display marks that there is no unique first direction.

Read the calculation source