PNA
¹H qNMR and Chemometrics of Heirloom Apple Juices and Ciders · PNA-WP-CIDER v3.0

12. Chemometrics: Unsupervised Analysis

12.1 Principal component analysis

The principal component analysis of the freeze-dried tubes is shown in Figure 39. The first three components carry 61.5, 11.3 and 9.8 % of the variance, and the loadings can be read like spectra. The first component is the sugar content. All of its large positive loadings belong to fructose and glucose, and the only negative loadings of any size belong to lactic acid, succinic acid and 1,3-propanediol, the constituents that increase as a cider becomes drier and more thoroughly fermented. The scores arrange the ciders accordingly from dry at the left to sweet at the right. The second component opposes lactic acid, acetic acid and 1,3-propanediol to sucrose and malic acid. It separates the lactate-dominant ciders, which lie above the axis whatever their sugar content, from the malate-dominant ones, and among the sweet ciders it distinguishes those sweetened with sucrose, at the bottom of the plot, from those that retain the sugars of the juice. The third component combines sucrose with lactic acid against fructose, glucose and malic acid and spreads the sucrose-sweetened group further. In other words, the three largest sources of variance in the spectra are the three decisions and events identified in Section 8: how much sugar remains, whether it is sucrose, and whether the malic acid has been converted.

Principal component analysis of the freeze-dried tubes of 87 ciders
Figure 39. Principal component analysis of the freeze-dried tubes of 87 ciders (optimized buckets, absolute intensities, mean-centered, Pareto-scaled). (a), (b) Scores; color gives the dryness class of the American Cider Association, marker shape the dominant acid; the dashed ellipse is the 95 % limit of Hotelling's T². Numbered points: 1, Stew Leonard's fresh cider (held two months); 2, J.K.'s Scrumpy Farmhouse; 3, Awestruck Hibiscus and Ginger; 4, Strongbow Gold Apple; 5, Graft Wild Woods; 6, Angry Orchard Crisp Apple; 7, Downeast Guava Passion Fruit; 8, Tim's Cider #1; 9, Graft Book of Nomad Gose; 10, Woodchuck Amber; 11, E.Z. Orchards Poire. (c) to (e) Loadings of the first three components against the centers of the buckets, with assignments; buckets above 5.8 ppm have loadings below 0.02 in absolute value and are not shown.

Two diagnostic statistics identify ciders that do not conform to the common pattern. Hotelling's T², calculated for a model of four components, exceeds its 95 % limit (10.4, from the F distribution) for seven ciders. Four of them are the sweetest products of the study, the fresh juice above all; two are the fruit-flavored ciders of Downeast that are sweetened with sucrose, which are extreme in the third component; and one is Graft Wild Woods, the cider richest in lactic acid. With 87 samples, four or five would be expected beyond such a limit by chance, so that the statistic does little more than name the extremes of the three axes just described. More informative is the residual, the part of a spectrum that the model does not describe. It is largest by a wide margin for the perry of E.Z. Orchards, whose sorbitol content has no counterpart among the apple ciders, and it is elevated for Graft Book of Nomad Gose (sorbitol and acetic acid), Downeast Cranberry Cider (citric and quinic acids) and Tim's Cider #1 (1,3-propanediol in place of glycerol). A large residual is thus a practical flag for a composition outside the experience of the model, which is the principle on which non-targeted screening of fruit juices is based.126,128

In the native tubes (Figure 40) ethanol takes the place of sugar as the dominant source of variance. The first component (56.3 %) is the alcohol content, with the two non-alcoholic ciders and the fresh juice at one end and the two strong ciders at the other; the second (19.8 %) is the sugar content, and the third (6.7 %) collects lactic acid, acetic acid and 1,3-propanediol. The loadings of this third component have a feature that deserves attention. They are of the same sign in nearly every bucket between 0.7 and 3.3 ppm, including buckets that contain no assigned signal. A pattern of this kind is not the spectrum of a compound; it is a broad background, either a baseline offset or the unresolved signal of macromolecules in an unfiltered cider, and the sample with by far the largest score, Tim's Cider #2, is a home-made cider. The native bucket table therefore contains a contribution that is not composition in the sense of Section 8, a point that recurs in Section 13.4.

Principal component analysis of the native tubes of 96 ciders
Figure 40. Principal component analysis of the native tubes of 96 ciders (optimized buckets, absolute intensities, mean-centered, Pareto-scaled). (a), (b) Scores, encoded as in the preceding figure. Numbered points: 1, Stew Leonard's fresh cider (held two months); 2, Original Sin White Widow (non-alcoholic); 3, 1911 Original Cider, alcohol removed; 4, Angry Orchard Strawman; 5, Etienne Dupont Cidre Triple; 6, Awestruck Hibiscus and Ginger; 7, J.K.'s Scrumpy Farmhouse; 8, Downeast Cranberry Blend; 9, Tim's Cider #2; 10, Tim's Cider #1; 11, Graft Book of Nomad Gose; 12, Citizen Cider Unified Press; 13, Angry Orchard Green Apple. (c) to (e) Loadings of the first three components with assignments.

The analysis of the concentration table leads to the same components with fewer variables. After Pareto scaling the first two components (42 and 22 %) are ethanol against the hexoses, and sucrose; after scaling to unit variance, which gives the minor constituents equal weight, the variance is spread over many components (22 % in the first), which shows how little the minor constituents are correlated with one another.

12.2 Hierarchical clustering

Whether the ciders fall into natural groups was examined by hierarchical clustering with Ward's method on the principal component scores of the freeze-dried tubes (Figure 41). The answer is that they do not, or only weakly. The mean silhouette width lies between 0.26 and 0.32 for every number of clusters from two to ten, without a maximum that would indicate a preferred number, and the cophenetic correlation of the dendrogram is 0.52. Values of this size describe a continuous distribution on which any partition is to some extent arbitrary. The partitions obtained from different representations of the same ciders agree only moderately: the adjusted Rand index between the clusterings of the freeze-dried buckets, the native buckets and the concentration table lies between 0.30 and 0.50 for four clusters and falls to 0.22 to 0.40 for five or six.

With that reservation, a division into four clusters gives a useful summary (Table 17). The first cluster (34 ciders) contains the dry and semi-dry ciders, two thirds of them lactate-dominant, with the highest alcohol and acetic acid contents; all home-made ciders, the Basque cider and most ciders of Graft, Bad Seed and Stormalong's dry products are found here. The second and largest (41 ciders) holds the semi-sweet ciders in which the sugars of the juice predominate and malic acid is intact. The third (6 ciders) consists of the products sweetened with sucrose, at a mean of 35 g/L: four ciders of Angry Orchard and Woodchuck and the two fruit-flavored ciders of Downeast. The fourth (6 ciders) comprises the sweetest products of the study, rich in glucose and fructose, among them the fresh juice. No cluster coincides with a measurement campaign. The ciders of each campaign are distributed over the clusters in accordance with their composition, and the lots of one Stormalong product are neighbors or near neighbors in the dendrogram, with the two lots that underwent malolactic conversion placed, correctly, among the lactate-dominant ciders.

Table 17. Mean composition of the four clusters obtained by Ward's method from the freeze-dried tubes (g/L unless stated otherwise).

ClusternEthanol (% v/v)SugarSucroseMalicLacticAceticGlycerolSorbitolkcal / 12 fl ozDry / Semi-Dry / Semi-Sweet / SweetLactate-dominant
1346.75.10.21.73.21.003.35.015825 / 7 / 2 / 024 of 34
2415.128.33.43.70.50.152.93.61550 / 5 / 34 / 26 of 41
365.051.235.03.20.10.073.01.91840 / 0 / 1 / 50 of 6
464.567.81.42.21.20.312.54.31980 / 0 / 0 / 63 of 6
Hierarchical clustering of the freeze-dried tubes of 87 ciders
Figure 41. Hierarchical clustering of the freeze-dried tubes of 87 ciders (Ward's method on the principal component scores that carry 97 % of the variance). The strips give, for each cider, the cluster at the four-cluster level (dashed line), the dryness class, the dominant acid, the presence of sucrose at 2 g/L or more, the market segment and the measurement campaign.

12.3 t-SNE and UMAP

Nonlinear embeddings are now routinely shown beside score plots, and their appeal is that they draw separate islands where PCA shows a cloud. That appeal is also their danger.238,239 Both methods were applied to the same scores as the clustering (Figure 42), and two properties were measured. Trustworthiness, the extent to which the neighbors of a point in the map are neighbors in the data, is 0.98 for t-SNE and 0.96 for UMAP against 0.95 for the first two principal components, so that the embeddings do represent local neighborhoods somewhat more faithfully than a two-dimensional score plot. Their reproducibility is less satisfactory. When the calculation is repeated from different random starting configurations, the sets of ten nearest neighbors in the map overlap by 0.78 (t-SNE) and 0.64 (UMAP) on average, and for UMAP the overlap falls further when larger neighborhoods are used. A fifth to a third of the local structure of such a map is therefore a product of the particular run.

What is stable is the content already known from PCA and clustering. Both maps show a dry, lactate-dominant branch, a dry, malate-dominant group formed largely by Stormalong and Bad Seed ciders, a semi-sweet body, and the sucrose-sweetened and very sweet groups at the periphery; the lots of one product lie together, as do the five sour ciders measured in 2017, which come from one producer. The gaps between the islands, their relative distances and their sizes have no meaning and were not interpreted. In this data set the embeddings are an effective picture of results obtained by other means and add nothing to them.

t-SNE (top) and UMAP (bottom) embeddings of the freeze-dried tubes of 87 ciders
Figure 42. t-SNE (top) and UMAP (bottom) embeddings of the freeze-dried tubes of 87 ciders, calculated from the same principal component scores as the clustering and colored by cluster, by dryness class and dominant acid, and by measurement campaign. Trustworthiness and the agreement of nearest-neighbor sets between runs with different random starts are given at the left.