Capability Gap Radar — Methodology Note

How SHAP weights and Country RCA are computed for the Atlas radar panel

Author

Net Zero Industrial Policy Lab · Johns Hopkins SAIS

Published

May 18, 2026

1 What the Radar Shows

The Capability Gap Radar in the NZIPL Atlas displays two overlaid polygons for a given country × technology × year:

Polygon Colour Meaning Source
Amber (filled) #f59e0b SHAP weight — what the ML model says matters for this technology pc_features.csv
Dashed (tech colour) tech-specific Country RCA — how specialised the country actually is pc_rca.parquet

A dotted ring marks RCA = 1 (the competitive threshold). Each axis = one of five product categories: Chemicals · Electronics · Industrial Materials · Machinery · Metals.

The gap between the two polygons on any axis signals a capability gap — the model predicts that category matters (high SHAP) but the country lacks specialisation (low RCA).


2 SHAP Weights — What the Model Needs

2.1 Source: data/pc/pc_features.csv

Columns: tech | hs_code | description | category | shap_mean_z
Rows:     one per (tech × HS product)

The shap_mean_z field is computed in the NZIPL Python ML pipeline:

  1. A Random Forest is trained on a panel of (country × HS product × year) observations. The binary label is whether the country has RCA > 1 in that product (see ML Explainer §2).
  2. SHAP values are computed for every observation — each value measures how much a given product feature “pushed” the prediction up or down.
  3. Values are z-scored across all observations to make features with different scales comparable.
  4. The mean absolute z-score across all (country, year) observations gives shap_mean_z for each (tech, hs_code). A higher value = more consistent predictive influence (ML Explainer §4).

Key point: shap_mean_z is not country-specific — it is the model’s global assessment of how important each product is for predicting competitiveness in that technology, averaged equally across all 155 countries and all years in the training set.

2.2 Aggregation to category level

The Atlas aggregates product-level shap_mean_z to the five SHAP categories, then renormalises over HS-based categories only (see §6 for why macro features are excluded):

\[ w_c^{\text{tech}} = \frac{\sum_{k \in \text{cat}_c} \text{shap\_mean\_z}_{k}^{\text{tech}}}{\sum_{c' \in \text{HS cats}} \sum_{k \in \text{cat}_{c'}} \text{shap\_mean\_z}_{k}^{\text{tech}}} \]

The amber polygon axis \(c\) has length \(r_c = R \cdot \min(2 w_c, 1)\), so a category capturing 50% of SHAP weight reaches the outer ring.


3 Country RCA — What the Country Has

3.1 Source: data/pc/pc_rca.parquet

Columns: iso3 | category | tech | year | rca | country | region
Rows:     one per (country × tech × category × year)

The category-level RCA for country \(i\), technology \(T\), category \(c\), year \(t\) is:

\[ \text{RCA}_{i,c,T,t} = \frac{X_{i,c,T,t} / X_{i,\cdot,T,t}}{X_{\cdot,c,T,t} / X_{\cdot,\cdot,T,t}} \]

where \(X\) are bilateral export values from bilateral_ds (KUSD). Numerator = country \(i\)’s share of its own tech exports that falls in category \(c\); denominator = the world average share. RCA > 1 means the country is comparatively specialised in that category relative to all exporters.

Key point: RCA is country-specific and year-specific. The dashed polygon varies across countries; the amber polygon does not.

3.2 RCA for India · Solar · 2023

India · Solar · 2023 — RCA by product category
Category RCA Competitive
Chemicals 0.459 No
Electronics 0.189 No
Industrial Materials 0.226 No
Machinery 0.661 No
Metals 0.928 No

4 Classification Rules: The WP-4 3×3 Grid

Each axis is classified by crossing two independent thresholds — SHAP level (how much the model weights this category for the technology) and RCA level (how specialised the country actually is). This produces a 3×3 grid with seven distinct policy-relevant cells (WP-4, §3).

4.1 Threshold definitions

SHAP level (what the technology needs):

Level Threshold Meaning
High \(w_c \geq 25\%\) Critical driver — this category dominates the model’s predictive signal
Medium \(10\% \leq w_c < 25\%\) Important contributor
Low \(w_c < 10\%\) Supporting role only

RCA level (what the country has):

Level Threshold Meaning
Strength \(r_c \geq 1.0\) Country exports more than its world share — genuine specialisation
Partial \(0.5 \leq r_c < 1.0\) Below-threshold but approaching competitiveness
Weak \(r_c < 0.5\) No meaningful specialisation in this category

4.2 The 3×3 classification grid

Strength \(r_c \geq 1\) Partial \(0.5 \leq r_c < 1\) Weak \(r_c < 0.5\)
High SHAP \(\geq 25\%\) 🟢 leverage 🟠 build_up 🔴 critical_gap
Medium SHAP 10–25% 🟡 mature_strength 🟠 build_up 🟥 gap
Low SHAP \(< 10\%\) 🔵 bonus_strength not_priority not_priority

4.3 Policy reading per cell

Classification Policy orientation
leverage Country has what this technology most demands. Anchor FDI here; use as supply-chain nucleus.
mature_strength Real supporting capability. Useful but not alone decisive. Maintain and deepen.
bonus_strength Genuine capability in a cluster this tech doesn’t weight heavily. May be more decisive for a different technology — don’t anchor tech-specific strategy here.
build_up Close enough to matter. Targeted investment to cross the RCA = 1 threshold has high expected returns.
critical_gap The model’s top driver is missing. Hardest problem — requires upstream industrial policy (sector-building), not just incentives.
gap Secondary driver missing. Important to address but not a show-stopper on its own.
not_priority Neither the tech nor the country prioritises this cluster. Low-salience for strategy.

“It would be applying a false level of precision to the model and misinterpret what it is telling us. We can have confidence in the simpler, but more elegant finding that the knowledge and capabilities required to succeed in industrial development differs across technology areas.” — WP-4, p.10

The framework operates at the cluster level by design. Individual HS6 codes that surface as top SHAP features are signals of what kinds of capabilities matter, not a prescription to build specific products.


5 Worked Example: India · Solar (2023)

India · Solar · 2023 — WP-4 7-class classification (matches Figure 4)
Category SHAP % RCA SHAP level RCA level Classification Axis length
Chemicals 38.9 0.46 high weak critical_gap 78% of R
Electronics 22.7 0.19 medium weak gap 45% of R
Industrial Materials 2.7 0.23 low weak not_priority 5% of R
Machinery 12.0 0.66 medium partial build_up 24% of R
Metals 23.7 0.93 medium partial build_up 47% of R

The figure reproduces WP-4 Figure 4 exactly. Chemicals is the critical_gap: SHAP 39% (high) × RCA 0.46 (weak). Metals and Machinery are build_up (medium SHAP × partial RCA). Electronics is a gap (medium SHAP × weak RCA). Industrial Materials is not_priority (low SHAP, weak RCA — the single quartz sand product matters little at this stage of India’s solar ambitions).


6 How the Gap Drives Policy Reasoning

The diagnostic power comes from reading both signals together. Neither metric alone is sufficient:

  • RCA alone tells you what a country is good at, but not whether those capabilities matter for the technology you care about. India has strong metals RCA — but metals carry only 24% SHAP weight for Solar, so “you have metals” is a weaker policy anchor than it looks.
  • SHAP alone tells you what the technology needs globally, but not whether any specific country is positioned to deliver. Solar needs chemicals — but a country with RCA 2.0 in chemicals faces a very different situation from one with RCA 0.1.

Reading the gap on a single axis:

High SHAP + Low RCA  →  critical_gap   The country lacks what matters most.
                                        Policy: sector-building, upstream industrial strategy.
                                        Cannot be fixed by incentives alone.

High SHAP + High RCA →  leverage       The country has what matters most.
                                        Policy: anchor FDI, attract supply-chain firms,
                                        use as a nucleus for downstream development.

Low SHAP + High RCA  →  bonus_strength The country is good at something the model
                                        doesn't weight for THIS technology.
                                        Policy: pivot — this capability may be decisive
                                        for a different technology (e.g., India's metals
                                        strength is more decisive for Wind than Solar).

Low SHAP + Low RCA   →  not_priority   Neither the tech nor the country prioritises this.
                                        Ignore for this country×tech pair.

Reading across axes (the full radar shape):

The amber polygon (SHAP) is the demand surface — fixed per technology, same for all countries. The dashed polygon (RCA) is the supply surface — unique to each country. The overlap area is the strategic sweet spot: where what the tech needs and what the country has coincide.

A country whose dashed polygon lies mostly inside the amber polygon (supply < demand everywhere) faces broad capability gaps and needs long-run industrial policy. A country where the dashed polygon exceeds the amber on several axes but falls short on the highest-SHAP axis faces a more concentrated, addressable problem.


7 Empirical Validation: SHAP Predicts Trade Intensity

A natural question is whether the model’s SHAP importance scores are circular — do they simply reflect existing trade patterns? The scatterplot report (qmd/scatterplot_report.qmd) tests this directly using OLS: log10(trade % GDP) ~ SHAP mean |z| across products for 2023.

Key findings:

Finding Result Interpretation
E1 — Overall SHAP slope on exports is statistically significant for most technologies Products the RF values are also traded more intensively in practice — model is not circular
E2 — By function Product Components show the strongest positive slope (***) ML-trade alignment is tightest at the component level of the supply chain
E2 — Final Products Negative slope (significant) Final product HS codes all get uniformly high SHAP; actual exports are concentrated in 1–2 dominant exporters (China for PV, Denmark for Wind), so among other top exporters the correlation inverts
I1 — Imports SHAP predicts import intensity more strongly than exports High-SHAP products are often capital goods — countries import them to build production capacity before developing export competitiveness
I2 — Process Equipment Strongest import slope Confirms that machinery for manufacturing is acquired first, exported second
E5 — Time Gap between high-SHAP and low-SHAP export intensity widening 2018–2024 The model’s importance scores map onto a real and growing divergence in trade patterns

Why this matters for the radar. The scatterplot findings confirm that the amber polygon (SHAP weights) is not a tautology of trade data — it is an independent signal from the Random Forest that happens to correlate with, and in some dimensions precede, actual trade specialisation. A country with a critical_gap in Chemicals for Solar is not just defined as lacking by the model: countries that closed this gap historically went on to trade more intensively in those exact products.

The asymmetry between imports and exports is particularly important for policy: build_up countries should expect to first see an import surge in high-SHAP capital goods (Process Equipment) as they invest in production capacity, before the corresponding export signal materialises. A rising import slope in the right product categories is therefore an early positive indicator, not a deficit signal.


8 What the Radar Does and Does Not Capture

8.1 Specificity: tech-specific vs country-specific vs country×tech-specific

The radar combines two signals with different scopes:

Signal Varies by Current source Country-specific?
SHAP weight (amber) Tech only pc_features.csv — global mean across 155 countries
Country RCA (dashed) Country × Tech × Year pc_rca.parquet
Country-specific SHAP Country × Tech Not yet stored — requires pipeline change
PC score Country × Tech × Year pc_scores.parquet

What country-specific SHAP would add. The Python pipeline computes a SHAP value for every individual (country, year, hs_code) observation before averaging. For India × Solar, the model may rely more heavily on Machinery features (where India has meaningful RCA = 0.66, giving the RF a real signal to use) and less on Chemicals (where RCA = 0.46 yields a near-zero signal). Restricting the average to India’s own observations would produce an amber polygon shaped by India’s actual position on the decision trees — potentially shifting the classification from CRIT GAP to BUILD on some axes.

Note

Path to country-specific SHAP. The developer can share the serialised model object (joblib.dump(model, 'rf_solar.pkl') in Python). We can then load it and call shap.TreeExplainer(model).shap_values(X_india) for any country’s feature matrix without retraining anything. Alternatively, a single additional groupby(['iso3','tech','category']) in the pipeline before the mean aggregation step would output the needed file directly.

8.2 Category definitions: HS chapters

The five SHAP categories are a property of the HS code, not of the technology. They follow standard HS chapter groupings and were verified to be perfectly consistent across techs — zero cases of the same HS code assigned to different categories for different technologies.

SHAP Category HS Chapters Examples
Chemicals 28–39 Inorganic/organic chemicals, plastics, polymers, paints, photographic materials
Electronics 85 Electrical machinery, semiconductors, instruments
Machinery 84, 86–96 Mechanical appliances, optical/measuring instruments, vehicles
Metals 26, 71–83 Ores, iron/steel, copper, aluminium, precious metals
Industrial Materials 25, 27, 44, 68–70 Minerals, petroleum, wood, ceramics, glass
Other 1–24 Agricultural commodities, food (mainly biofuel feedstocks)

These two columns (shap_category, shap_category_source) have been added to data/green_dict/green_dictionary.csv — the master HS code reference file — for all 605 entries. 373 rows carry a pc_features source (directly confirmed by the ML model’s above-threshold SHAP values); the remaining 232 are chapter_inferred.

8.3 Number of products per category × technology

The table below shows how many distinct HS products the ML model assigned to each category for each technology in pc_features.csv (model-confirmed products only). Cells showing 1 identify categories where the entire SHAP weight rests on a single HS code.

Number of HS products per category × tech in pc_features.csv (NA = category absent)
Technology Chemicals Electronics Industrial Materials Machinery Metals
Solar 13 8 1 4 8
Wind 9 6 1 19 15
Batteries 15 2 1 10 3
Transmission 1 3 1 12 7
Nuclear 5 NA 1 5 11
Biofuel 17 NA 14 18 7
Electrolyzers 15 1 NA 19 7
Geothermal 6 3 4 27 14
Heat Pumps 1 3 2 12 8
Magnets 1 1 1 2 3

Reading the table. Several patterns stand out:

  • Industrial Materials has 1 product for Solar, Wind, Transmission, Batteries, Electrolyzers, and Magnets — in each case a single raw material or intermediate (quartz sand for Solar, timber panel for Wind, crude petroleum for Transmission). The category label “Industrial Materials” disguises this: it is not an aggregate of many similar products but a single pivot input that the model finds highly diagnostic.
  • Machinery is the most populated category across all techs, reflecting the broad range of specialised process equipment needed at each production stage.
  • Nuclear and Electrolyzers have no Electronics products in the model’s confirmed feature set — consistent with those being primarily metallurgical and mechanical supply chains.
  • Biofuel has the largest Other category (10 products: agricultural feedstocks, vegetable oils) which is entirely absent from all other technologies.
Single-product categories: the one HS code carrying 100% of that category’s SHAP weight
Technology Category HS Code Description SHAP mean|z|
Batteries Industrial Materials 251020 Natural calcium phosphates, natural aluminium calcium phosphates and phosphatic chalk; ground 0.504
Electrolyzers Electronics 851430 Furnaces and ovens; industrial or laboratory, other than those functioning by induction, dielectric loss or resistance heated 0.538
Heat Pumps Chemicals 281820 Aluminium oxide; other than artificial corundum 0.637
Magnets Chemicals 283324 Sulphates; of nickel 0.593
Magnets Electronics 851440 Heating equipment; for the heat treatment of materials by induction or dielectric loss, industrial or laboratory, other than furnaces and ovens 0.558
Magnets Industrial Materials 680421 Millstones, grindstones, grinding wheels and the like; of agglomerated synthetic or natural diamond 0.585
Nuclear Industrial Materials 250410 Graphite; natural, in powder or in flakes 0.519
Solar Industrial Materials 250510 Sands; natural, silica and quartz sands, whether or not coloured 0.509
Transmission Chemicals 281820 Aluminium oxide; other than artificial corundum 0.669
Transmission Industrial Materials 270900 Oils; petroleum oils and oils obtained from bituminous minerals, crude 0.817
Wind Industrial Materials 441520 Wood; pallets, box pallets and other load boards; pallet collars 0.501

8.4 Are the averages weighted?

shap_mean_z is an unweighted mean of absolute SHAP z-scores across all (country, year) observations. Specifically:

  1. For each observation, SHAP produces a raw push value for every feature.
  2. These are standardised (z-scored) across all observations for that feature — so a z-score of 2 for China × Solar in 2018 is on the same scale as a z-score of 2 for Fiji × Solar in 2018.
  3. The absolute value is taken, then averaged equally across all observations.

Consequences of equal weighting:

  • China ($100B in solar panels) counts the same as a small island economy in shaping shap_mean_z. The amber polygon reflects what matters for the average country in the training set, not for large exporters.
  • Observations where the model is very confident get the same vote as uncertain predictions.
  • If averaged instead by export volume, the Chemicals axis would likely shrink (large exporters have diversified chemistry) and Machinery would grow.

The country RCA axis is similarly unweighted in its construction — it is a ratio relative to world averages, not scaled by a country’s absolute export size.


9 Critical Limitation: Macro Features Excluded from the Radar

The model uses two types of features. For Solar, ordered by shap_mean_z:

The six macro indicators — FDI inflows, trade openness, tariff measures, industry GDP share, total GDP, and manufacturing share — collectively account for 16% of total SHAP weight for Solar, yet they are excluded from the radar because they do not map to a product category.

The radar’s SHAP shares are therefore renormalised over the HS-based categories only. “Chemicals = 39%” means Chemicals accounts for 39% of the HS-product portion of model importance, not 39% of total model importance. If macro features were included as a sixth radar axis, all five existing axes would shrink by roughly one-third.

Warning

Implication for interpretation. The radar shows capability gaps in tradeable product categories. It does not capture the role of FDI attraction, trade openness, or manufacturing depth — which the model finds at least as important as any product category. A country could close all five product gaps and still score poorly if it lacks the macro-economic conditions the model relies on. The radar is a necessary but not sufficient diagnostic.


10 Relationship to the ML Pipeline

For fuller context see:

  • ML Pipeline Explainer — end-to-end walkthrough of the Random Forest, SHAP computation, and PC scores for a non-technical audience.
  • ML Pipeline Review — critical review of SHAP feature importance, RCA data coverage, and the SHAP ↔︎ trade correlation.

10.1 Data lineage

bilateral_ds (BACI trade flows)
  └─► 08_build_unilateral.R
        └─► pc_rca.parquet          ← Country RCA (dashed polygon)

NZIPL Python ML pipeline
  features: product-level RCA + 6 macro indicators
  target:   RCA > 1 per product (binary)
  train RF → compute SHAP per (country, year, hs_code)
  z-score → mean |z| across all countries → shap_mean_z
        └─► pc_features.csv         ← SHAP weights (amber polygon, HS only)

[not yet exported]
  groupby iso3 before averaging → per-country shap_mean_z
        └─► pc_features_by_country  ← country-specific amber polygon (future)

Note on country specificity. Because the amber polygon is a global average, it will look the same for India and for Germany on any given tech. The dashed RCA polygon carries all the country-specific signal in the current design. Country-specific SHAP would allow the amber polygon to shift based on which categories the model actually uses when processing a specific country’s feature vector.