PCA for materials data · Part 1 of four ·

Why do we need PCA for materials data?

An aerial view of trees with different autumn colors.
Photo by Aaron Burden. Wikimedia Commons, CC0.

We have several measurements for every specimen. How can we examine them together when we cannot directly view more than three spatial dimensions?

Our materials measurements

Suppose we have 300 alloy specimens prepared under different conditions. We record five measurements for each specimen: mean grain size, yield strength, ultimate tensile strength, elongation at fracture and electrical conductivity. Each measurement is a feature. Each row of our spreadsheet describes one specimen.

The following spreadsheet is synthetic. Its numbers were created for this example, not measured in an experiment. We use it to learn the method, rather than establish a relationship for a particular alloy.

First 6 of 300 specimens. Units are included in the column headings.
SpecimenMean grain size (μm)Yield strength (MPa)Ultimate tensile strength (MPa)Elongation at fracture (%)Electrical conductivity (MS/m)
S00126.0280.0434.022.026.3
S00238.6259.8405.420.727.3
S00319.4292.4447.716.327.6
S00436.1267.9422.724.726.6
S00546.0240.2382.723.626.1
S00620.0286.6451.918.128.4

The complete example contains 300 rows. Download the spreadsheet or the CSV file. Each row is one specimen. Each measurement column is one quantity.

What do these measurements and units mean?

Mean grain size is the average of the measured grain sizes within a specimen. μm means micrometer, one millionth of a meter.

Yield strength is the stress at which a specified amount of permanent deformation occurs. Ultimate tensile strength is the maximum engineering stress reached in a tensile test. MPa means megapascal, one million pascals.

Elongation at fracture describes how much the specimen's gauge length has increased when it breaks, as a percentage of its original gauge length.

Electrical conductivity describes how readily a material carries electric current. MS/m means megasiemens per meter. M means mega, or one million, and S means siemens.

Why did we choose μm, MPa, and MS/m? Could we use m, Pa, and S/m instead? The measurements would be the same, but the numbers would change. Keep this question in mind. We will discuss units and scaling in Part 3.

Let us compare two specimens

S003 has a mean grain size of 19.4 μm; S005 has 46.0 μm. Their yield strengths are 292.4 and 240.2 MPa, and their tensile strengths are 447.7 and 382.7 MPa. S003 therefore has smaller grains and higher values of both strength measurements.

Its elongation at fracture is lower, 16.3% compared with 23.6%. Its conductivity is slightly higher, 27.6 compared with 26.1 MS/m. We are considering five differences together. Comparing two rows raises questions, but does not establish a relationship across all 300 specimens.

Across the whole dataset, do smaller grains generally accompany higher strength? Does elongation decrease when strength increases? Does conductivity follow those changes, or show a different pattern? These are questions we want to investigate.

Where do we put five measurements?

We can put grain size on one axis and yield strength on another. That is a two-dimensional plot. We can add tensile strength as a third axis. But where do we put elongation and conductivity? We cannot draw five mutually perpendicular spatial axes that we can directly view.

Color and marker size can represent additional quantities. Separate plots also help. But following all the measurements together becomes difficult. Five features give ten different pairs to inspect. With 100 features, there are 4,950 pairs.

We want a simpler picture that uses information from all five measurements, rather than a picture that simply leaves three columns out.

What does PCA offer?

Principal component analysis, or PCA, constructs new quantities by combining the original measurements. We can use two or three of these combinations as plot axes. Each point still represents one specimen. Each new axis represents a calculated combination, rather than a single spreadsheet column.

Keeping fewer combinations loses some detail. We must check how much of the variation in our measurements the simpler picture retains. We must also use materials knowledge to interpret it. PCA alone cannot show that grain size caused a change in strength.

How should we choose the combinations?

We would like two or three new axes. But which measurements should contribute to each axis, and how should we combine them? We want grain size, both strengths, elongation and conductivity to contribute to the calculation.

We need answers to two questions. First, how should we combine the measurements? Second, how much of the difference between specimens does each combination describe?

The mathematics used by PCA provides both answers. It uses quantities called eigenvectors and eigenvalues. We do not need to understand these words yet. For now, we only need to know why we are going to learn about them: they help us construct the new axes and decide which ones are useful.

In the next article, we begin with a sheet and arrows drawn on it. We take one step at a time before returning to the materials measurements.

Acknowledgment and further reading

We consulted Jonathon Shlens's A Tutorial on Principal Component Analysis (2005, Version 2) while preparing this series. It explains PCA through changes of basis, covariance and the relationship with singular value decomposition. A later version is available on arXiv.