ML on the Materials Project, part 8: opening the box
The series finale: which features does the model actually use, and did it learn real chemistry? Yes, worn as a proxy nobody expected.
Eight parts of this series have trained models and reported scores. Part 8 does something different: it cross-examines the trained Random Forest itself, asks which features it actually relies on and how, and closes the series out.
Two questions, two tools
Which features matter? Permutation importance answers this by taking the trained model and the held-out test set, shuffling one feature’s column at a time (destroying its information while keeping its statistics intact), and measuring how much the score drops. A big drop means the feature was genuinely being used. No drop means decoration. This is model-agnostic and honest, and it is run here on properly grouped test data (part 4’s law), so a feature cannot look important merely for helping the model memorise polymorphs.
How does each feature act? Partial dependence sweeps one feature across its whole range while averaging over everything else, tracing the shape the model actually learned, the place where a chemist can step in and argue with the model directly.
(The industry favourite for explaining individual predictions is SHAP, Shapley values borrowed from game theory: “for this specific material, electronegativity spread contributed plus 0.8 eV.” Its dependencies do not support this series’ Python version, so the two sklearn-native tools above answer the same underlying questions at the dataset level instead.)
The ranking (R2 lost when shuffled, grouped test set)
| feature | drop | feature | drop | |
|---|---|---|---|---|
| mass_spread | 0.471 | mass_mean | 0.067 | |
| row_mean | 0.207 | en_spread | 0.065 | |
| frac_oxygen | 0.205 | en_min | 0.053 | |
| en_mean | 0.135 | row_spread | 0.032 | |
| z_mean | 0.090 | z_spread | 0.014 | |
| en_max, n_elements | 0.002 |
The verdict on part 1’s suspicion
Part 1’s crude first look suggested mass and atomic-number features might matter more than electronegativity spread, and chemistry raised an eyebrow at that. The honest cross-examination confirms the ranking, but with a twist that teaches the tool’s own limits.
en_max scored 0.002, dead last, because in an oxide, the most electronegative element is almost always oxygen itself. The feature is nearly a constant across the entire dataset, useless by construction, and it shipped through eight parts of this series without anyone noticing. And because en_max is nearly constant, en_spread (which equals roughly 3.44 minus en_min) is nearly a twin of en_min. Correlated twins split their credit under permutation importance, 0.065 plus 0.053, rather than one of them getting full recognition. The electronegativity story was never actually absent from the model. It was diluted across redundant features, while mass_spread kept its own credit whole. Even the interpretation tools have their own blind spots, and reading them well means knowing where those blind spots are.
The shapes: real chemistry, worn as a proxy

The partial dependence plot for mass_spread has a dramatic cliff: predicted gaps sit near 3 eV when mass_spread is tiny (below roughly 30), plunge to around 0.6 across the 40-to-55 range, then settle into a moderate plateau. Translated into chemistry: in an oxide, mass_spread is roughly a measurement of how heavy the cation is compared to oxygen. A tiny spread means light cations, and light-element oxides are exactly the famous wide-gap insulators, silica, alumina, magnesia. The 40-to-55 band is row-four transition-metal territory, classic small-gap chemistry. row_mean declines more gently across the same range, heavier periodic rows, smaller gaps, which is also real.

The Random Forest learned genuine chemistry. It simply expressed that chemistry through mass as a rough periodic-table coordinate, rather than through electronegativity the way a textbook might expect. A model finds whichever encoding of the truth happens to be cheapest in the features it was actually given.
The episode in one takeaway
Opening the box is not optional decoration. It caught a near-constant feature, a pair of credit-splitting twins, and a chemistry story hiding behind an unexpected proxy. A model that cannot be interrogated is a model that cannot be trusted, and now there is a working method for interrogating one.
The series, closed: what eight parts taught
| Part | Question | Honest answer |
|---|---|---|
| 1 | Can a straight line predict gaps from composition? | R2 about 0.07. No. |
| 2 | Can trees? | 0.638… |
| 3 | Is it a metal? | 77% accurate, but misses 43% of real metals |
| 4 | Were we lying to ourselves? | Yes: 30% of the forest’s skill was leakage. Truth: 0.446 |
| 5 | What does chemical space look like? | Filaments, families, and clusters of the wrong thing |
| 6 | Can statistics find errors with no rules at all? | Yes: found the +8.99 eV/atom entry unaided |
| 7 | Can a model know its own limits? | Yes: calibrated bars, a self-measured 0.72 eV noise floor |
| 8 | Did it learn real chemistry? | Yes, worn as a mass-proxy costume |
The recurring character across this entire series was never really a model. It was the representation ceiling, crystal polymorphs invisible to composition-only features, appearing in some form in every single part. That is exactly the setup for the deep learning series to come, where structure-aware models finally get the chance to see what these features never could.
Found a mistake? Good, tell me. This publication flags its own suspect values. Reach me on LinkedIn.