Unsupervised Learning for Molecular & Materials Discovery:
Dimensionality Reduction, Clustering & Catalyst Discovery
Lecture 03 roadmap: three progressive pillars
03a–03cDimensionality Reduction
Linear PCA geometric intuition, why StandardScaler is mandatory, interpreting loadings chemically, 17D Applicability Domain checks, and nonlinear t-SNE manifolds on 2,048-bit Morgan fingerprints.
Clustering & Strict Splits
K-means Assign–Update loop from scratch, local optima & k-means++, Elbow & Silhouette, DBSCAN for non-convex shapes, Taylor–Butina sphere exclusion, and GroupKFold Cluster Splits.
Science 2021 Catalyst Case
Reproducing Hueffel et al. (Science 2021): finding new dinuclear Pd(I) catalysts from 348 phosphine ligands with only 4 known positives using 1,000-run Consensus K-means & dimer DFT descriptors.
From Supervised to Unsupervised: learning from X alone
Input: (X, y) → Output: f(X) ≈ y
- Requires hundreds to thousands of labeled experiments (e.g., 9,482 AqSolDB
log Svalues). - Evaluated against ground-truth test labels (RMSE, R2, ROC-AUC).
- Blind spot: cannot tell you if a new molecule lies far outside training chemistry without an explicit AD check.
Input: X only → Output: Structure
- Chemical-space mapping: compress 17–2,048 features into 2D maps (PCA, t-SNE) to spot trends & outliers.
- Family discovery: partition libraries into structural families (K-means, DBSCAN, Taylor–Butina).
- Honest validation: build
GroupKFoldcluster splits so homologs never leak across train/test. - Ultra-low-data discovery: find analogs around 3–5 known hits (Consensus Clustering).
Two philosophies of dimensionality reduction
Principal Component Analysis
- Rotates axes onto orthogonal directions of maximum global variance.
- Deterministic & fast: exact linear algebra (SVD); same result every run.
- Transformable:
pca.transform(X_new)projects new molecules onto the exact same map. - Interpretable: loadings tell you what each axis means chemically.
Manifold & Neighbor Embedding
- Preserves local pairwise similarities (who is whose nearest neighbor in high-D).
- Breaks linear bottlenecks on sparse 2,048-bit Morgan fingerprints.
- Caveat: stochastic, non-parametric (t-SNE has no
.transform()), and global distances between islands are distorted!
PCA geometric intuition: rotating axes onto maximum variance
MolWt vs. HeavyAtomCount) collapse onto a single principal axis (PC1)Why StandardScaler is mandatory before PCA
MolWt (50–2,000 g/mol) has 104× larger variance than NumAromaticRings (0–10)StandardScaler() before PCA on mixed-unit descriptors—otherwise unit scale masquerades as physical importance.Explained variance on AqSolDB (17 descriptors)
Interpreting PCA loadings: chemical meaning of PC1 & PC2
pca.components_ reveal which physical descriptors drive each principal axis2D PCA chemical space map colored by solubility
Solubility, yet PC2 aligns with the Yalkowsky hydrophobicity axis (r = −0.49)Projecting organic semiconductors & 17D Applicability Domain
C8-BTBT (1.85) and rubrene (2.19) far exceed the 95th-percentile 17D distance (1.34), whereas pentacene (0.18) sits near dibenzanthracene isomers.Why linear PCA fails on 2,048-bit Morgan fingerprints
t-SNE: preserving local neighborhoods on a nonlinear manifold
PCA(50) denoising → TSNE(perplexity=30, init='pca')Inside a t-SNE island: similarity meets Activity Cliffs
log S)Four rules for reading t-SNE plots (plus UMAP & TMAP)
Cluster size ≠ chemical diversity
t-SNE expands dense regions and compresses sparse ones—a huge island on screen does not mean wider chemical variance.
Distances between islands are meaningless
Two islands on opposite sides of the plot are not necessarily less similar than two adjacent islands.
perplexity sets the zoom level
Low perplexity (5–10) fragments data into tiny micro-clusters; moderate (30–50) balances local neighborhoods.
Use init="pca" + fixed random_state
Random initialization varies across runs; UMAP is faster and supports .transform() for new molecules.
K-means from scratch: the 2-step Assign–Update loop
Local optima trap & why k-means++ + n_init=10 matter
init='k-means++' and n_init=10 (or higher) to escape local minima.Choosing the number of clusters k: Elbow vs. Silhouette
When K-means fails: non-convex shapes & DBSCAN
-1), though it is sensitive to eps.High-D fingerprint distances & Hierarchical Clustering
Cheminformatics standard: Taylor–Butina clustering
d = 1 - TanimotoSim across all molecule pairs.cutoff to that centroid, then repeat until only singletons remain.Key Practical Advantages
- Guaranteed similarity radius: every molecule in a cluster is ≥ (1 − cutoff) similar to the cluster representative.
- No forced merging: unique scaffolds stay as singletons rather than corrupting other families.
- Representative picking: selecting 1 molecule per Butina cluster yields a maximally diverse screening subset.
Strict validation: Cluster Split (GroupKFold) vs. Random CV
GroupKFold)—exposing the true cost of cross-family extrapolation.Case study: discovering dinuclear Pd(I) catalysts (Science 2021)
Why Standard Tools Failed
- DFT failure: computing ΔG of dimerization fails to separate active dimers from inactive monomers/species.
- Supervised ML failure: only 4 known positives exist among 348 phosphine ligands in the LKB-P database—impossible to train a classifier!
- Data gotcha:
LKB_P.csvuses semicolon delimiters (sep=";").
Guilt-by-Association in DFT Space
- Represent all 348 ligands by 28 quantum-chemical DFT descriptors (sterics, electronics, Tolman angle, HOMO/LUMO).
- Find which ligands consistently co-cluster with the 4 known Pd(I)-forming ligands across 1,000 clustering runs.
- Refine the shortlist with 36 dimer-specific DFT descriptors before stepping into the wet lab.
Why 2D PCA on 28 DFT descriptors is not enough
Round 1: 1,000-run Consensus K-means in 28D LKB-P space
Round 2: 36D Dimer-DFT descriptors → 21 finalists → 8 new catalysts
Four materials informatics lessons from the Science case study
Monomer → Dimer DFT Funnel
Cheap monomer descriptors (LKB-P, N = 348) filtered the library first; expensive dimer-specific DFT descriptors (N = 66) resolved the true catalytic physics.
Consensus Over Single-Run Luck
Running K-means 1,000 times converted stochastic cluster boundaries into a continuous, reproducible ranking score.
4 Positives Is Enough to Start
You do not need 1,000 labeled rows to apply ML—unsupervised neighborhood discovery works with just 3–5 known hits.
Human-in-the-Loop Synthesis
Chemist intuition filtered 21 finalists down to 10 synthesizable ligands, achieving 8 experimentally confirmed Pd(I) dimer catalysts.
Practical cheat-sheet: which unsupervised method should I choose?
| Method | Input Type | StandardScaler? |
Needs k? | Best Materials Science Use Case |
|---|---|---|---|---|
| PCA | Continuous descriptors | Mandatory! | No (choose % var) | Remove collinearity, interpret chemical axes (loadings), project new molecules |
| t-SNE / UMAP | Morgan FP (via PCA 50) | No (binary FP) | No (perplexity) |
Visualize local chemical islands & Activity Cliffs in large libraries |
| K-means | Continuous / PCA-FP | Mandatory! | Yes (Elbow/Silh.) | Fast spherical partitioning; GroupKFold cluster splits on PCA-reduced FPs |
| DBSCAN | Low-D continuous | Mandatory! | No (eps, min_samples) |
Non-convex manifolds & automatic outlier / noise flagging (label -1) |
| Taylor–Butina | Tanimoto distance (FP) | No | No (cutoff) |
Cheminformatics family clustering & diverse library subset selection |
| Consensus K-means | DFT descriptors | Mandatory! | Yes (1,000× runs) | Target-focused analog discovery from 3–5 known hits (Science 2021 Pd(I) case) |
Summary (Take home notes)
- Standardize before linear/distance methods: PCA, K-means, and DBSCAN are unit-sensitive—always apply
StandardScaleron mixed-unit descriptors. - Read PCA loadings & check full-D AD: On AqSolDB, 5 PCs capture >90% variance and PC2 recovers hydrophobicity without labels, while 17D nearest-neighbor distance catches out-of-domain semiconductors.
- Use t-SNE for local islands, never global distances: Linear PCA fails on sparse 2,048-bit Morgan fingerprints;
PCA(50) → t-SNEreveals chemical islands and Activity Cliffs. - Validate out-of-family with Cluster Splits: Taylor–Butina and K-means +
GroupKFoldprevent homologous leakage and reveal true cross-family generalization error. - Up next (Lecture 04): Moving from passive exploration to active experimental design—using Gaussian Processes and Bayesian Optimization to choose the next best experiment.
Thanks for your listening
03d_exercises.ipynb