---
title: "2026-08-27 ve2e ISUP and QWK code inspection"
description: "Reviewed reusable ISUP prediction, patient label sourcing, aggregation, and QWK evaluation paths in ve2e."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-08-27 ve2e ISUP and QWK code inspection

## Work Done

- Inspected `src/ve2e/training/metrics.py`, the validation accumulation and callback code, dataset metadata flow, inference scripts, and inference tests.
- Identified the shared Gleason-logit-to-ISUP functions and the current quadratic Cohen kappa implementations.
- Confirmed that `patient_id` and ISUP labels originate in the infofile, while the slice inference script currently groups by `vol_id` despite calling the result per-patient.
- Recommended an importable patient-level ISUP/QWK subroutine in `src/ve2e/inference/metrics.py` with explicit aggregation and edge-case handling.
- No ve2e files were edited.

## Lessons Learned: Pitfalls

- The knowledge skill requires a clinical workstream index and SOP index, but those paths do not exist in the current knowledge checkout.
- Existing code uses “patient-level” for some metrics that are still sample- or volume-level. Names alone are not enough to infer aggregation granularity.

## Lessons Learned: Improvements

- Add a clinical workstream landing page and SOP index to the knowledge base.
- Document the intended hierarchy of slice, volume, and patient aggregation for ve2e evaluation, including how conflicting ISUP labels across volumes are resolved.

Source: https://docs.virdx.dev/knowledge/inbox/2026-08-27-clinical-ve2e-isup-qwk-code-inspection/index.mdx
