Skip to content
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bb4ba45
Initial commit for the shapley value integration for NNPDF usage.
rbonnetguerrini Feb 25, 2026
cf0fff6
linking to shapley-values repo
rbonnetguerrini Feb 25, 2026
9079a7c
fixing commenting
rbonnetguerrini Feb 25, 2026
3ee96e2
adapting for all dataset type + includes variants and cfac in the loa…
rbonnetguerrini Feb 25, 2026
ef2d808
adding a progress tracker for the nbr of inference
Feb 26, 2026
dfc0133
test identity on cluster
rbonnetguerrini Feb 26, 2026
3cbcfe0
example notebook for shapley values
rbonnetguerrini Feb 26, 2026
d83d0fa
integration of the parallele computing from https://github.com/rbonne…
rbonnetguerrini Feb 27, 2026
d373ef1
Several experiment per job, new perturbation types, ablation and cali…
rbonnetguerrini Mar 2, 2026
370d067
making Shapley Values UQ + Fixing extreme SV outlier
rbonnetguerrini Mar 5, 2026
66419f6
new plotting
rbonnetguerrini Mar 13, 2026
e3db0bf
few fixes + read me
rbonnetguerrini Mar 13, 2026
3541813
small fixes
rbonnetguerrini Mar 13, 2026
ca2590b
new runcard sorting
rbonnetguerrini Mar 13, 2026
8919c2c
small fixes runcards
rbonnetguerrini Mar 13, 2026
5449120
adding new runcards, + reorganizing them
rbonnetguerrini Mar 13, 2026
1c796fb
New UQ quantification for perturbation. Now set one perturbation mask…
rbonnetguerrini Mar 24, 2026
73f33fd
Parallelizing the compute of each experiment within a runcard
rbonnetguerrini Mar 24, 2026
514125e
new perturbation + dense heatmap plotting
rbonnetguerrini Mar 27, 2026
2255f19
Add runcards for DY and DIS in flavour basis
evagroenendijk Apr 10, 2026
fb1c8f4
Runcards for CC and NC DIS in evolution basis
evagroenendijk Apr 10, 2026
abee282
Merge branch 'regression_stability' into sv_analysis
scarrazza Jun 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -436,5 +436,9 @@ Session.vim
# auto-generated tag files
tags

# Shapley values results
sv_results



# End of https://www.gitignore.io/api/c++,latex,cmake,python,jupyternotebook,qtcreator,vim
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ vp-list = "validphys.scripts.vp_list:main"
vp-nextfitruncard = "validphys.scripts.vp_nextfitruncard:main"
vp-hyperoptplot = "validphys.scripts.vp_hyperoptplot:main"
vp-deltachi2 = "validphys.scripts.vp_deltachi2:main"
vp-shapley = "validphys.shapley.scripts.vp_shapley:main"

[tool.poetry.dependencies]
# Generic dependencies (i.e., validphys)
python = ">=3.9"
shapley-values = {git = "https://github.com/rbonnetguerrini/shapley-values.git", branch = "main"}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest @rbonnetguerrini to make a release of his code and upload to PyPI, so we avoid installing from git.

matplotlib = "^3.9"
pineappl = "^1.0.0"
# TODO: make the code compatible with pandas 3
Expand Down
65 changes: 65 additions & 0 deletions validphys2/src/validphys/shapley/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"""Shapley value analysis for NNPDF PDF flavour importance.

Subpackage of validphys that provides tools for computing exact Shapley values to quantify the importance of individual PDF flavours in constraining experimental observables.

Uses the external ``shapley_values`` package for the problem-agnostic available at https://github.com/rbonnetguerrini

Shapley computation, and wraps NNPDF-specific components:
- Dense FK tensor convolution for fast repeated chi2 evaluation
- Gaussian perturbation of PDF grid values
- MSR + VSR sum rule enforcement
- Evolution / physical-flavor basis support

Typical usage via CLI::

vp-shapley runcards/sv_dis_hera.yaml

Or from Python::

from validphys.shapley import (
setup_observables,
NNPDFShapleyAnalyzer,
)
"""

from .setup import (
setup_observables,
get_pdf_grid_values,
get_pdf_flavor_grid_values,
get_pdf_grid_values_all14,
FKEntry,
NNPDFObservable,
FLAVOR_PDG_NAMES,
)
from .perturbation import (
gaussian_profile,
apply_gaussian_perturbation,
PERTURBATION_MODES,
PERTURBATION_XSPACES,
)
from .sumrules import (
gen_integration_input,
compute_sumrule_normalization,
)
from .analyzer import NNPDFShapleyAnalyzer

__all__ = [
# Setup
"setup_observables",
"get_pdf_grid_values",
"get_pdf_flavor_grid_values",
"get_pdf_grid_values_all14",
"FKEntry",
"NNPDFObservable",
"FLAVOR_PDG_NAMES",
# Perturbation
"gaussian_profile",
"apply_gaussian_perturbation",
"PERTURBATION_MODES",
"PERTURBATION_XSPACES",
# Sum rules
"gen_integration_input",
"compute_sumrule_normalization",
# Analyzer
"NNPDFShapleyAnalyzer",
]
Loading
Loading