CaMa indicators and follow-up list, model governance page

This commit is contained in:
Roberto Treviño
2026-11-25 23:20:52 -06:00
parent 9b02641804
commit 53a6393cb2
19 changed files with 974 additions and 19 deletions
+19
View File
@@ -0,0 +1,19 @@
import { interpretabilityFigures } from './figures';
describe('governance figures', () => {
it('draws a survival report as curves with bands and the model points', () => {
const [found] = interpretabilityFigures({
kind: 'curves',
curves: [
{ name: 'Kaplan-Meier', months: [0, 6], survival: [1, 0.9], low: [1, 0.8], high: [1, 1] },
],
predicted: { name: 'Modelo', months: [6], survival: [0.92], low: [0.85], high: [0.97] },
});
expect(found.figure.data.length).toBe(3); // band, curve, model points
expect((found.figure.data[2] as any).error_y.array[0]).toBeCloseTo(0.05);
});
it('draws nothing for a report it does not know', () => {
expect(interpretabilityFigures({ kind: 'other' })).toEqual([]);
});
});