Skill Tracer
Skills › Scientific Agent Skills › clinical-decision-support › model_biomarker_evaluation.md

model_biomarker_evaluation.md

152 lines · skills/clinical-decision-support/references/model_biomarker_evaluation.md at 5f2bc03

Open on GitHub

Most marks come from matching words in the file, so treat them as pointers.

1# Aggregate Model and Biomarker Evaluation
2

Aggregate Model and Biomarker Evaluation

Raw lines 1 to 2
3## Boundary
4
5Evaluate a locked model, assay, or prespecified biomarker rule using synthetic or aggregate validation summaries. Do not:
6
7- ingest individual records;
8- discover or optimize a threshold;
9- assign a class or risk to a person;
10- match a person to a test or intervention;
11- state clinical validity, utility, safety, or fitness for deployment.

Boundary

Evaluate a locked model, assay, or prespecified biomarker rule using synthetic or aggregate validation summaries. Do not:

  • ingest individual records;
  • discover or optimize a threshold;
  • assign a class or risk to a person;
  • match a person to a test or intervention;
  • state clinical validity, utility, safety, or fitness for deployment.
Raw lines 3 to 12
13## Define the Target
15Record:
17- evaluation target and version;
18- biomarker category using FDA-NIH BEST terminology;
19- intended research purpose;
20- target population, setting, prevalence, and outcome horizon;
21- intended user and non-clinical decision role;
22- inputs, output, threshold, and threshold provenance;
23- development, tuning, internal-test, and external-validation datasets;
24- whether evaluation is temporal, geographic, site-based, or population-based.
26Do not call a random split from one source “external validation.”

Define the Target

Record:

  • evaluation target and version;
  • biomarker category using FDA-NIH BEST terminology;
  • intended research purpose;
  • target population, setting, prevalence, and outcome horizon;
  • intended user and non-clinical decision role;
  • inputs, output, threshold, and threshold provenance;
  • development, tuning, internal-test, and external-validation datasets;
  • whether evaluation is temporal, geographic, site-based, or population-based.

Do not call a random split from one source “external validation.”

Raw lines 13 to 27
28## Analytical and Clinical Questions
30Keep separate:
321. **Analytical validation** — measurement accuracy, precision, detection limits, reproducibility, interference, specimen stability.
332. **Clinical validation** — association or predictive performance for the defined context.
343. **Clinical utility** — whether use improves meaningful outcomes compared with alternatives.
36The bundled evaluator addresses only selected aggregate clinical-validation performance summaries. It cannot establish any of the three.

Analytical and Clinical Questions

Keep separate:

  1. Analytical validation — measurement accuracy, precision, detection limits, reproducibility, interference, specimen stability.
  2. Clinical validation — association or predictive performance for the defined context.
  3. Clinical utility — whether use improves meaningful outcomes compared with alternatives.

The bundled evaluator addresses only selected aggregate clinical-validation performance summaries. It cannot establish any of the three.

Raw lines 28 to 37
38## Performance Dimensions

Performance Dimensions

Raw lines 38 to 39
40### Discrimination
42Depending on the target:
44- sensitivity and specificity;
45- predictive values, with prevalence/context;
46- likelihood ratios;
47- C statistic/AUC with uncertainty;
48- time-dependent discrimination for censored outcomes.
50Do not report accuracy alone when classes are imbalanced.

Discrimination

Depending on the target:

  • sensitivity and specificity;
  • predictive values, with prevalence/context;
  • likelihood ratios;
  • C statistic/AUC with uncertainty;
  • time-dependent discrimination for censored outcomes.

Do not report accuracy alone when classes are imbalanced.

Raw lines 40 to 51
52### Calibration
54Calibration asks whether predicted probabilities agree with observed frequencies. Evaluate:
56- calibration-in-the-large;
57- calibration slope;
58- calibration plots with uncertainty;
59- observed versus predicted risk across meaningful ranges;
60- integrated or absolute calibration error when justified.
62The standard-library helper accepts calibration bins and reports a weighted absolute gap. Its `calibration_in_the_large_gap` field is mean predicted probability minus observed event proportion on the probability scale; it is not the logistic calibration intercept. Bin totals and observed events must match the same group and confusion matrix, including when disclosure suppression applies. Binning loses information and does not replace individual-level calibration analysis in an approved environment.
64Primary overview: [Van Calster et al., calibration](https://pubmed.ncbi.nlm.nih.gov/31842878).

Calibration

Calibration asks whether predicted probabilities agree with observed frequencies. Evaluate:

  • calibration-in-the-large;
  • calibration slope;
  • calibration plots with uncertainty;
  • observed versus predicted risk across meaningful ranges;
  • integrated or absolute calibration error when justified.

The standard-library helper accepts calibration bins and reports a weighted absolute gap. Its calibration_in_the_large_gap field is mean predicted probability minus observed event proportion on the probability scale; it is not the logistic calibration intercept. Bin totals and observed events must match the same group and confusion matrix, including when disclosure suppression applies. Binning loses information and does not replace individual-level calibration analysis in an approved environment.

Primary overview: Van Calster et al., calibration.

Raw lines 52 to 65
66### Overall Accuracy and Utility
68Use proper scoring rules and decision-curve/net-benefit methods only with a prespecified, defensible decision context. Do not imply utility from AUC or accuracy. Utility evaluation that changes care is outside this skill.

Overall Accuracy and Utility

Use proper scoring rules and decision-curve/net-benefit methods only with a prespecified, defensible decision context. Do not imply utility from AUC or accuracy. Utility evaluation that changes care is outside this skill.

Raw lines 66 to 69
70### Uncertainty
72Report intervals for performance estimates and explain resampling or analytic methods. A zero denominator is undefined, not zero performance: the helper emits `null` estimates/interval endpoints. Balanced accuracy requires both observed outcome classes, otherwise it is `null` and excluded from subgroup differences. The helper uses Wilson intervals for aggregate proportions. It does not model correlated observations, clustering, repeated measurements, censoring, or verification bias.

Uncertainty

Report intervals for performance estimates and explain resampling or analytic methods. A zero denominator is undefined, not zero performance: the helper emits null estimates/interval endpoints. Balanced accuracy requires both observed outcome classes, otherwise it is null and excluded from subgroup differences. The helper uses Wilson intervals for aggregate proportions. It does not model correlated observations, clustering, repeated measurements, censoring, or verification bias.

Raw lines 70 to 73
74## External Validation
76Apply the original locked model without refitting. Document:
78- differences in case mix, prevalence, setting, workflow, and measurement;
79- eligibility and missingness;
80- sample-size rationale based on precision targets, not a blanket event rule;
81- calibration, discrimination, and any prespecified utility measure;
82- subgroup performance;
83- model failures and unusable inputs;
84- whether recalibration was separate from validation.
86See [BMJ 2024 external-validation guidance](https://www.bmj.com/content/384/bmj-2023-074820) and [sample-size methodology](https://pmc.ncbi.nlm.nih.gov/articles/PMC8352630).

External Validation

Apply the original locked model without refitting. Document:

  • differences in case mix, prevalence, setting, workflow, and measurement;
  • eligibility and missingness;
  • sample-size rationale based on precision targets, not a blanket event rule;
  • calibration, discrimination, and any prespecified utility measure;
  • subgroup performance;
  • model failures and unusable inputs;
  • whether recalibration was separate from validation.

See BMJ 2024 external-validation guidance and sample-size methodology.

Raw lines 74 to 87
88## Subgroup and Fairness Evaluation
90Before analysis:
92- identify groups based on intended use, evidence, and stakeholder input;
93- document category provenance and limitations;
94- set minimum precision and disclosure rules;
95- plan intersectional analyses where feasible;
96- define metrics and acceptable uncertainty;
97- evaluate measurement and label validity;
98- plan investigation and mitigation, not only detection.
100Report:
102- representation and missingness;
103- performance and calibration with intervals;
104- data quality and failure rates;
105- distribution shift;
106- human-AI interaction where relevant;
107- observed differences without declaring a group deficient.
109No single parity metric establishes fairness. Equal metrics can coexist with inequitable outcomes, and unequal metrics may reflect case mix, measurement, structural conditions, or model behavior that requires investigation.

Subgroup and Fairness Evaluation

Before analysis:

  • identify groups based on intended use, evidence, and stakeholder input;
  • document category provenance and limitations;
  • set minimum precision and disclosure rules;
  • plan intersectional analyses where feasible;
  • define metrics and acceptable uncertainty;
  • evaluate measurement and label validity;
  • plan investigation and mitigation, not only detection.

Report:

  • representation and missingness;
  • performance and calibration with intervals;
  • data quality and failure rates;
  • distribution shift;
  • human-AI interaction where relevant;
  • observed differences without declaring a group deficient.

No single parity metric establishes fairness. Equal metrics can coexist with inequitable outcomes, and unequal metrics may reflect case mix, measurement, structural conditions, or model behavior that requires investigation.

Raw lines 88 to 110
111## Biomarker-Specific Controls
113- Pre-specify specimen, assay, platform, software, quality controls, units, and threshold.
114- Preserve continuous information where appropriate.
115- Separate prognostic association from treatment-effect interaction.
116- Blind assay assessment to outcome when feasible.
117- Account for batch/site effects and failed measurements.
118- Validate thresholds independently.
119- Report analytical validity before clinical interpretation.
120- Use REMARK for tumor prognostic markers.

Biomarker-Specific Controls

  • Pre-specify specimen, assay, platform, software, quality controls, units, and threshold.
  • Preserve continuous information where appropriate.
  • Separate prognostic association from treatment-effect interaction.
  • Blind assay assessment to outcome when feasible.
  • Account for batch/site effects and failed measurements.
  • Validate thresholds independently.
  • Report analytical validity before clinical interpretation.
  • Use REMARK for tumor prognostic markers.
Raw lines 111 to 121
122## Change Control and Monitoring
124For each release record:
126- immutable model/assay version;
127- data and code versions;
128- planned changes and rationale;
129- validation protocol and acceptance criteria;
130- subgroup/calibration regression tests;
131- human-factors impact;
132- approval and rollback;
133- monitoring cadence and drift triggers;
134- incident handling and retirement.
136Never update a threshold or model silently after viewing performance.

Change Control and Monitoring

For each release record:

  • immutable model/assay version;
  • data and code versions;
  • planned changes and rationale;
  • validation protocol and acceptance criteria;
  • subgroup/calibration regression tests;
  • human-factors impact;
  • approval and rollback;
  • monitoring cadence and drift triggers;
  • incident handling and retirement.

Never update a threshold or model silently after viewing performance.

Raw lines 122 to 137
138## Aggregate Evaluator
140Input contains only:
142- group labels and aggregate denominators;
143- confusion counts;
144- aggregate calibration bins;
145- provenance and validation metadata.
147Output contains bounded descriptive metrics, uncertainty, suppression, and documented gaps. Invalid inputs return failure diagnostics with no partial group metrics. The helper emits JSON only; it does not produce calibration plots, bin-level Wilson intervals, forest plots, or fitted calibration models. It never outputs a person-level class or recommendation.
149```bash
150python3 scripts/model_biomarker_evaluation.py \
151 assets/aggregate_model_evaluation_template.json
152```

Aggregate Evaluator

Input contains only:

  • group labels and aggregate denominators;
  • confusion counts;
  • aggregate calibration bins;
  • provenance and validation metadata.

Output contains bounded descriptive metrics, uncertainty, suppression, and documented gaps. Invalid inputs return failure diagnostics with no partial group metrics. The helper emits JSON only; it does not produce calibration plots, bin-level Wilson intervals, forest plots, or fitted calibration models. It never outputs a person-level class or recommendation.

python3 scripts/model_biomarker_evaluation.py \
  assets/aggregate_model_evaluation_template.json
Raw lines 138 to 152
Runs code python3 scripts/model_biomarker_evaluation.py :150