geoprior.scripts.plot_xfer_impact#

Plot impact transferability.

This figure extends plot_transfer.py by adding decision-maker oriented diagnostics:

Panels#

  1. Retention vs target baseline (overall): - R² retention = R² / R²_baseline - MAE retention = MAE_baseline / MAE

  2. Horizon retention (H1–H3) for R².

  3. Coverage–sharpness tradeoff (@80) per direction.

  4. Threshold risk skill (optional if eval CSVs exist): - Reliability diagram for exceedance - Brier score summary

  5. Hotspot stability (optional): - Jaccard@K overlap of top-K hotspots - Spearman rank correlation on overlap - Optional error bars (mean ± std) - Optional time-series small multiples

Inputs#

Requires xfer_results.csv (from nat.com/xfer_matrix.py).

For panel (d), it also uses xfer_results.json if available, to locate per-job csv_eval paths.

Run (module form required)#

python -m scripts plot-xfer-impact      --src results/xfer/nansha__zhongshan      --split val      --calib source

Functions

figSx_xfer_impact_main([argv, prog])

main([argv, prog])

parse_args([argv, prog])

render(df, *, split, calib, strategies, ...)

Classes

TextFlags(show_legend, show_labels, ...)

class geoprior.scripts.plot_xfer_impact.TextFlags(show_legend: 'bool', show_labels: 'bool', show_ticklabels: 'bool', show_title: 'bool', show_panel_titles: 'bool', title: 'str | None')[source]#

Bases: object

Parameters:
  • show_legend (bool)

  • show_labels (bool)

  • show_ticklabels (bool)

  • show_title (bool)

  • show_panel_titles (bool)

  • title (str | None)

show_legend: bool#
show_labels: bool#
show_ticklabels: bool#
show_title: bool#
show_panel_titles: bool#
title: str | None#
__init__(show_legend, show_labels, show_ticklabels, show_title, show_panel_titles, title)#
Parameters:
  • show_legend (bool)

  • show_labels (bool)

  • show_ticklabels (bool)

  • show_title (bool)

  • show_panel_titles (bool)

  • title (str | None)

Return type:

None

geoprior.scripts.plot_xfer_impact.render(df, *, split, calib, strategies, directions, rescale_mode, baseline_rescale, horizon_metric, cov_target, threshold, xfer_rows, add_hotspots, hotspot_k, hotspot_score, hotspot_horizon, hotspot_ref, hotspot_style, hotspot_errorbars, out, text)[source]#
Parameters:
Return type:

tuple[Path, Path]

geoprior.scripts.plot_xfer_impact.parse_args(argv=None, *, prog=None)[source]#
Parameters:
Return type:

Any

geoprior.scripts.plot_xfer_impact.figSx_xfer_impact_main(argv=None, *, prog=None)[source]#
Parameters:
Return type:

None

geoprior.scripts.plot_xfer_impact.main(argv=None, *, prog=None)[source]#
Parameters:
Return type:

None