Repository navigation
feat(engine): display batch prediction XAI in a notebook widget - #410
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Pre-merge checks:
|
| Check name | Status | Explanation |
|---|---|---|
| Pr Size | The PR base is feat/training-xai-widget, and its head is feat/batch-xai-widget. The local checkout has no ref for either branch. The PR's own work is the three commits on top of f2815a9, which is an … | |
| Public Resource Access | The check covers only external resource references (URLs, repository locations, package sources) that this PR adds or modifies. I compared the PR's commits (454acf0 through 8482870, with 454acf0's … |
Full details: Pr Size
-
Explanation
The PR base is feat/training-xai-widget, and its head is feat/batch-xai-widget. The local checkout has no ref for either branch. The PR's own work is the three commits on top of f2815a9, which is an ancestor of HEAD: 454acf0, 808682f and 8482870. Comparing 454acf0^ to HEAD (no merge commits in range) changes 16 files. Those 16 files are the PR's own changes, so the count is 16. That is at or below the 40-file limit, so the check passes. Caveat: the local history also holds the training-widget commits. Comparing against origin/main shows 341 files, but that is not the PR's diff. The PR is stacked on the training branch, so that count does not apply. Line counts were ignored, as the check requires.
Full details: Public Resource Access
-
Explanation
The check covers only external resource references (URLs, repository locations, package sources) that this PR adds or modifies. I compared the PR's commits (454acf0 through 8482870, with 454acf0's parent f2815a9 as the base) and searched every added diff line for http(s) URLs, www hosts, markdown links, script/CDN sources, import-from-URL statements, git+/git@ or registry/index references, and package-source changes. The search found none. The only matches were false positives on identifiers. The explainability.md additions contain no links, and no pyproject, package.json, requirements, or lock file changed. The contributor's PR description links to PR
#409and a change-map comment, but those appear in the PR text, not in the changed code, so they fall outside this check. The check requires no public-access verification because no external resource reference was added or modified. The PR's own changes do not add any.
Full details: Change Map Design Review
-
Explanation
Summary: I could not read the change map comment (marker
<!-- kumo-pr-change-map -->, cited as 7002013964). No tool here reads PR conversation comments, and the comment is not in the repository. The standing FAIL therefore cannot be confirmed as addressed. Code-side evidence in the local checkout confirms the core concern: shared-path behavior that affects training is changed by the batch commits. Checkout identity. Local HEAD is84828701. Its batch-specific commits are454acf06,808682f0, and84828701, on top of the training widget history. The base54048a25and headf88b08b3cited by the prior run are not present locally. I could not confirm that this checkout matches the current provider head. Prior claims checked. - Refuted:MAX_GROUPSandcollector_carddo not appear at84828701.card()is in_subgraphs.py. Both prior claims about these symbols are wrong. - Unverified: the comment's missing stopping condition, observed failure, requirement source, and omitted shared-path rows. These depend on comment text I could not read. Shared-path changes confirmed in the batch diff (training-visible, not provably absent from the comment): 1._subgraphs.pycard()now filterscategoriesto IDs fromexplanations.samples(). Norun.batchguard applies to this filter. Training also calls this function. 2._columns.pygroup_viewaddsshare = entry.prediction_score / total_score if total_score else 0. The zero-total guard applies to every caller. 3._columns.pygroup_viewrefactors series building. It also changesgapto require'actual' in series, and it useslen(pops)forn. 4._columns.pycohorts()adds arun.batchbranch that returnsanalysis.cohorts or None. 5._columns.pygroups()sets the title to'Cohorts' if run.batch else 'Column groups'. 6._run.pyaddsbatchandcohort_rowsfields.gradientreturnsNonefor batch.explanation_coverageadds batch-only text. 7.shell.jsdrops the tab strip only forkind === 'prediction'. Batch cohort bound. I could not find anum_cohortssource inpackages/kumo-engineat84828701. The producer bound is unverified. Design questions (uncertain, not proven defects). The shared functions branch onrun.batchin at least five places. A separate batch adapter may be simpler. The author should decide and record the reason. Basis for FAIL. The standing failure requires FAIL when its claims cannot be confirmed. The unresolved concern is that the comment must document each shared-path change above, with its training effect, plus the stopping condition, observed failure, requirement source, and cohort bound.Resolution
Update the change map comment (
<!-- kumo-pr-change-map -->) and the design as follows: - Add rows for each shared-path change listed above. For each row, state whether training output can change and why. - Forcard(), state whether training can receive a differentcategory_samplesresult. Add a test, or confirm that training output is unchanged, when the filter applies. - Forshare,group_view,cohorts(), andgroups(), state the training-visible effect of each change. - Replace the_columns.py"Emit only predictions" row with the full behavior change. - State the batch cohort count bound and its source in the producer code. - Add the observed failure and requirement source to the comment. Name the linked issue or request. - Add a stopping condition, for example: the batch loader, status, export, and browser checks in the listed tests pass. - Movewidget_exports.cjsto a separate optional section. - Decide and record whether a separate batch adapter is simpler than therun.batchbranches. Give the reason. - Confirm the comment matches the current PR head. Re-run the design review after the update.
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Change mapBatch view built on the training widget's shared reader, cards and frontend; batch explanation replay now also keeps each sample's prediction.
|
af77350 to
f88b08b
Compare
0a99c49 to
c9e52ff
Compare
prediction.visualize() and PredictionExplanations.load(path).visualize() open the training widget's cohort and subgraph cards over a batch's retained PRED-stage explanations: batch identity and row count, an availability card per producer, a cohorts chart of predictions only, allowlisted sampled subgraphs with their recorded predictions, a static snapshot, and the existing HTML and PDF exports. Both widgets share the run reader, card builders and front end; a single tab shows without a tab strip.
The PRED replay now also writes the collector's output format, so a sampled subgraph from trainer.predict(..., explanations=True) shows its recorded prediction. A live manifest with a null typed field still has its surviving model and snapshot IDs checked against the retained record. An unreadable sampled graph no longer hides the readable ones when the task comes from samples. Only a batch drops the tab strip, so a training view restored from its bundle keeps its Evaluation tab. The widget status test reuses the producer-outcome parametrization.
f88b08b to
808682f
Compare
|
|
@Vedaant-J Addressed the two small items.
The |
Summary
Display saved batch-prediction explanations with
prediction.visualize()orPredictionExplanations.load(path).visualize().The widget shows the batch identity, which explanation producers ran, a cohort chart of predictions and sampled subgraphs with their recorded predictions.
It reuses the training widget's run reader, card builders and frontend, so both views share one code path.
Opening it only reads retained files and never reruns prediction or explanation generation.
What Happens and Why
A batch run with
explanations=Truekeeps cohorts and sampled subgraphs on disk, but there is no notebook view of them.The training widget expects targets, holdout files and a training trial, and a batch has none of these.
Opening it on a batch would show actual-value bars, ground-truth rows and evaluation tabs with nothing behind them.
The Fix
Batch explanation replay now keeps each sampled subgraph's prediction, and the widget reads samples through the explanation reader so the producer allowlist holds.
A batch loader checks that the saved explanations belong to this batch, combines attached and recorded producer status, and builds a structured identity header.
The batch view is a single panel without a tab strip, and the static snapshot draws the default cohort chart with the existing comparison bars.
HTML and PDF exports work unchanged; the HTML file is named
kumo-prediction-explanations.html.Blast Radius
Training views are unchanged on screen, and the only generation change is one extra per-sample prediction file in batch explanation output.
This stacks on the training widget PR #409; merge that first. The batch XAI API (#289) is already in that branch.
Verification
Explainability tests pass, and screenshots of six batch variants in light and dark match the previous revision except for the shown predictions and shared snapshot bars.
The browser export harness was run manually, outside CI, because it needs retained real fits; it passed in Chromium, Firefox and WebKit, including a downloaded batch HTML reopened with its selections.
Change map.