Iterative Trace Partitioning in Practice: a Worked Example on the Sepsis Cases Log

A step-by-step case study of one analysis session in TracePrism, kept as a supplementary reference alongside the TVCG submission and as teaching material for students learning the tool and the underlying method.

Dataset: Sepsis Cases (hospital ER trajectories; Mannhardt & Blinde, "Analyzing the Trajectories of Patients with Sepsis using Process Mining", RADAR+EMISA 2017) · 1,050 traces, 16 activities · Session date: 2026-08-13 (revised) · Source material: the exported knowledge base (knowledge_groups.csv, knowledge_traces.csv, knowledge_report.html), the session log (analysis_log.html), and screen captures taken during the session. Click any figure to view it full-size.
Headline result. Across four iterative rounds — one obvious-group commit and three topic-modeling rounds, followed by a UMAP + k-means clustering round on the final residue — the session accumulated 20 committed groups covering 939 of 1,050 traces (89.4%). The remaining 111 traces (10.6%) resisted separation and were left unexplained, skewed toward the escalation outcomes IC_then_NC and NC_then_IC (see the final section).
Contents
  1. Getting oriented: dataset overview and the process graph
  2. Step 1 — An obvious group: the ER triage-only path
  3. Step 2 — First topic round: K=18 on the 1,015-trace remainder
  4. Step 3 — Second round: K=8 on the 230-trace remainder
  5. Step 4 — Third round: K=7 on the 160-trace remainder (a thin round)
  6. Step 5 — UMAP + k-means (N=8) on the 153-trace residue
  7. Final knowledge base and what was left unexplained
  8. Takeaways for students

Getting oriented: dataset overview and the process graph

STEP 0Stage 1 (Overview) always summarizes whatever is currently in the "remaining" working set — at the very start of a session, that is the whole log. Sepsis Cases is a much smaller, denser dataset than the Road Traffic Fines log used in the companion case study: 1,050 traces, only 16 distinct activities, median length 13 events, and five outcomes rather than four — NC_only 66.7% (no ICU admission ever), no_admission 22.9% (released without any ward admission at all), IC_then_NC 5.9% (ICU, later stepped down to a normal-care ward), NC_then_IC 3.6% (normal-care ward, later escalated to ICU), and IC_only 1.0%. Unlike the Fines log's clean numeric fields, Sepsis carries a rich set of clinical case attributes recorded at ER triage: four numeric lab values (CRP, leucocyte count, lactic acid, age band) and eight boolean SIRS/triage criteria (infection suspected, organ dysfunction, hypotension, hypoxia, and the four individual SIRS criteria plus their 2-or-more summary flag). A dataset note also warns that only the gaps between events are real — absolute calendar dates were randomized per case for anonymization — so the date heatmaps are not informative here the way they were for Fines.

Figure 1. Stage 1 overview of the full 1,050-trace dataset: headline counts, outcome legend, and the case-attribute data dictionary (four numeric lab values, eight boolean triage criteria). Note the outcome mix is heavily skewed toward NC_only (66.7%).
Figure 2. Stage 1 process graph (Disco-style DFG) of the whole dataset (bottom), alongside the obvious-groups panel (top right), which surfaces the session's first move: ER Registration → ER Triage → ER Sepsis Triage, 35 traces, 100% no_admission — patients whose case ended at triage with no further care activities recorded at all.

Step 1 — An obvious group: the ER triage-only path

STEP 1Sepsis has only one common short trace variant clearing the ≥20-occurrence bar for an "obvious group": the three-activity sequence ER Registration → ER Triage → ER Sepsis Triage, with no further activity recorded — 35 traces, 100% pure no_admission. This was committed immediately, for the same reason the two exit-ramp variants were committed first in the Fines case study: it is a free, zero-modeling win, and removing it up front narrows what Step 2's topic model has to explain. This step does not depend on any encoding choice, so it is identical to the earlier (buggy) run of this session.

Figure 3. The obvious-group panel immediately after committing the group: no other common short trace remains in the dataset, and the popup shows the committed group's outcome purity (100% no_admission) plus its attribute fingerprint — several boolean triage criteria read false in 97–100% of this group's traces, each far above the working-set baseline (+57 to +81 percentage points).
Reading the attribute fingerprint chips. Every group, topic, and cluster card in this dataset carries a small panel of case-attribute chips like the ones in Figure 3 — a first-pass account of why a group is homogeneous, not just that it is:
2+ SIRS CRITERIA MET
false 100% (+81pp)
Chip label + value + share. Each chip names one case attribute, the value (or range) most common in this group, and what share of the group's traces have it — only shown when that share is a real divergence from the working set as a whole (the "+81pp" is the percentage-point gap against the working-set baseline for that same value), not every attribute the dataset happens to record.
Outcome bar — the thin segmented bar under each card is that group/topic/cluster's outcome mix, in the fixed colors used throughout this dataset: no_admission, NC_only, IC_only, NC_then_IC, IC_then_NC.
T0 ✓ Checkmark — a ✓ after a topic/cluster label in the small-multiples and cluster-table views means it has already been committed to the knowledge base.

Step 2 — First topic round: K=18 on the 1,015-trace remainder

STEP 2With the obvious group removed, the encoding recommender was run against the remaining 1,015 traces — and this time its recommendation was actually applied, not just displayed. The top-ranked candidate was activities + 2-grams + attribute-augmented activity (sharp 0.819, NMI 0.305, score 0.562), clearly ahead of plain activities + 2-grams alone and ahead of encodings that add the numeric/boolean facets as separate columns instead of fusing them into the activity vocabulary. The attribute-augmented activity switch was turned on to match.

Figure 4. Stage 2 encoding recommendation for the 1,015-trace remainder: activities + 2-grams + attribute-augmented activity ranks first (score 0.562), ahead of encodings that add the numeric/boolean facets as separate columns (score 0.467) or that skip the attribute facet entirely (score lower still). This time the recommended switch was actually turned on before the K-sweep below.

A K-sweep from K=3 to K=20 was run and several candidate K's were compared under a dominant-outcome-share ≥ 0.85 (and n ≥ 10) rule; coverage rose steadily with K, from 740 of 1,015 traces at K=8 up to 785 at K=18 — the widest K tried and the one taken forward, since it maximized how many traces cleared the purity bar without any sign of the qualifying topics fragmenting into noise.

Figure 5. K-sweep pooled 2D embedding and Sankey, K=3–20, unfiltered — every topic from every K, with the outcome-pies toggle on: each dot's size is proportional to its topic's trace count and its slices show that topic's outcome mix, in the same fixed outcome colors used everywhere else in this document. This is the view to scan for outcome-pure topics (a dot dominated by one color) across the whole K range at a glance.
Figure 6. The same sweep filtered to dominant-outcome share ≥ 0.85: several persistent bands hold from the low K's through K=18–20, consistent with the coverage check above favoring the wide end of the swept range.

At K=18, thirteen of the eighteen topics cleared the purity bar and were committed: two large NC_only-dominant topics (T0, 241 traces, 98.8% pure; T1, 204 traces, 97.1% pure), one large no_admission-dominant topic (T2, 87 traces, 97.7% pure), and ten smaller topics ranging 87.5–100% pure across both outcomes (T5, T7, T9, T10, T11, T12, T13, T14, T15, T17; 14–41 traces each). Five topics stayed below the bar and were left for later rounds — T3, T4, T6, T8, and T16 — most notably T8 (70 traces), a mixed IC_then_NC-leaning topic at only 62.9% purity.

Figure 7. Term×topic heatmap for the K=18 fit: each row is a topic with its dominant outcome and top term weights. With attribute-augmented activity active, many top terms are fused attribute+activity tokens (e.g. Release A×InfectionSuspected:true) rather than plain activity n-grams — visibly different from an activities-only fit.
Figure 8. Small multiples of all 18 topics' process graphs, sized by raw trace count, captured before this round's commits — every topic shares the same simple, near-linear ER→triage→labs→release backbone typical of this dataset; the outcome bars underneath are what actually distinguish them, not the graph shape.
Figure 9. The same 18 topics, same moment, toggled to size-by-NMF-weight instead of size-by-count — a quick way to compare each topic's raw trace count against how much of the total NMF weight it actually carries, before opening any single one in detail.
Figure 10. Topic T0 detail (K=18, n=241): counts-based (left) vs. NMF-weight-based (right) process graph. S 3.7× · O 0.93 · 98.8% NC_only. Committed to knowledge.
Reading the process-graph edge colors here and throughout: the same edge is drawn once sized by raw count (left panel) and once sized by NMF weight (right panel); its color compares the two, on a scale relative to this topic's own largest count/weight — not a fixed global threshold.
Gold — weight exceeds count: distinctive of this topic specifically, even if the raw count is small.
Blue — count exceeds weight: common, but not distinctive (most traces do this, so it isn't a strong signature).
Gray — aligned: count and weight roughly agree.
Figure 11. The same 18 topics immediately after committing the 13 qualifying ones — each now carries a ✓ checkmark; the five left uncommitted (T3, T4, T6, T8, T16) show no checkmark.
Figure 12. Knowledge base after Step 2: 14 groups committed (1 obvious + 13 topics), 820 of 1,050 traces (78.1%) explained so far.
Reading the S/O coherence badge and the fingerprint chips, worked through on T0. Every committed group's heading carries a badge like T0's (S 3.7× · O 0.93) — two numbers computed against whatever population the group was drawn from at commit time:
S (structure coherence) — how internally similar the group's traces are to each other in topic-weight space, relative to a random same-size sample of the working set. T0's S 3.7× means its 241 traces were, on average, roughly three and a half times as behaviorally similar to each other as an arbitrary 241-trace sample of the 1,015-trace remainder would have been. (The Step 1 obvious group shows S – instead of a number: no topic fit existed yet when it was committed, so there is no topic-weight space to measure similarity in.)
O (outcome coherence) — how much a group's outcome mix reduces entropy (uncertainty) relative to its source population's own mix, on a 0–1 scale where 1.0 is single-outcome-pure. The obvious group's O 1.00 reflects its 100% purity exactly. T0's O 0.93 is close to that ceiling, consistent with its 98.8% purity.

T0's fingerprint panel also carries real chips this time — infection suspected true 100% (+19pp), IV infusion required true 93% (+17pp), SIRS: heart rate true 93% (+16pp), plus two more attributes reading well below their working-set baseline. That is a direct, visible consequence of the encoding fix above: with attribute-augmented activity actually switched on, these same attributes are fused into the tokens NMF fits topics on, so a topic like T0 that the model separates out cleanly is, unsurprisingly, also legible in terms of those attributes. (In the earlier, unfixed run — where this facet was silently never applied — the equivalent topic showed no attribute divergence at all, since nothing in its encoding could have produced one.)

Step 3 — Second round: K=8 on the 230-trace remainder

STEP 3The 230 traces left after Step 2 were re-scored. This round's own top-ranked candidate was, perhaps surprisingly, simpler than what was already active — plain activities alone (sharp 0.592, NMI 0.492, score 0.542) outranked every richer candidate at this quick-probe stage. Rather than strip out facets that had already proven useful in Step 2, the existing activities + 2-grams + attribute-augmented activity encoding was kept active; the fix applied in this session turns on whatever a round's scorer newly recommends, but does not retroactively remove facets a prior round already switched on. This is a judgment call worth flagging explicitly rather than leaving implicit.

Figure 13. Stage 2 encoding re-scored against the 230-trace remainder: the top-ranked candidate this round is simply activities (score 0.542) — the existing richer encoding from Step 2 was kept rather than narrowed.

A K-sweep (K=3–20) was compared across candidate K's under the same ≥0.80 purity / n≥8 rule; coverage peaked at K=8 (70 of 230 traces across two qualifying topics), ahead of every other K tried (25–69 traces).

Figure 14. K-sweep pooled 2D embedding and Sankey on the 230-trace remainder, K=3–20, unfiltered, outcome-pies toggle on (dot size ∝ trace count, slices ∝ outcome mix — see the legend under Figure 5).
Figure 15. The same sweep filtered to dominant-outcome share ≥ 0.80.

At K=8, two topics cleared the bar: T1 (25 traces, 96% no_admission) and T2 (45 traces, 82.2% NC_only, with small IC_only/NC_then_IC/IC_then_NC tails). The other six topics stayed mixed, ranging 53.5–75% purity.

Figure 16. Term×topic heatmap for K=8 on the 230-trace remainder. T1 and T2 (committed) sit clearly apart from the six uncommitted topics on outcome purity.
Figure 17. Small multiples of all 8 topics at K=8, before this round's commits.
Figure 18. Topic T1 detail (K=8, n=25): 96% no_admission, S 3.3× · O 0.88. Its fingerprint panel carries six lit chips, all boolean triage criteria reading false 96–100% of the time (up to +81pp over baseline) — the same “low-acuity, uneventful triage” signature as the Step 1 obvious group, just arrived at through topic modeling on a much narrower remainder. Committed to knowledge.
Figure 19. The same 8 topics immediately after committing T1 and T2.
Figure 20. Knowledge base after Step 3: 16 groups committed, 890 of 1,050 traces (84.8%) explained so far.

Step 4 — Third round: K=7 on the 160-trace remainder (a thin round)

STEP 4The 160 traces left after Step 3 were re-scored; the top-ranked candidate reverted to activities + 2-grams + attribute-augmented activity (sharp 0.767, NMI 0.324, score 0.545) — the same encoding already active, so nothing changed. A K-sweep (K=2–8) was compared under the same ≥0.80 / n≥6 rule this round, and the result was thin: K=2 through K=6 produced zero qualifying topics at any size, and K=7 and K=8 each produced exactly one, covering only 7 of the 160 traces (4.4%) — a sharp drop from every previous round.

Figure 21. Stage 2 encoding re-scored against the 160-trace remainder — the same top-ranked encoding as Step 2, unchanged from what was already active.
Figure 22. K-sweep pooled 2D embedding and Sankey on the 160-trace remainder, K=2–8, unfiltered, outcome-pies toggle on (dot size ∝ trace count, slices ∝ outcome mix — see the legend under Figure 5).
Figure 23. The same sweep filtered to dominant-outcome share ≥ 0.80: almost nothing qualifies across the whole K range, the visual signature of a remainder that is genuinely running out of separable structure.

At K=7, only T6 — a small, 7-trace topic (86% NC_only) — cleared the bar; the other six topics ranged 40–75% purity, including two sizeable but thoroughly mixed IC_then_NC-leaning topics (T2, 37 traces, 51.4%; T3, 32 traces, 62.5%) that no K in this sweep managed to resolve further. T6 is small enough (n=7) that its outcome-coherence badge could not be computed reliably and the app's own knowledge card shows no S/O figure for it at all — an honest "too small to score" rather than a suppressed one.

Figure 24. Term×topic heatmap for K=7 on the 160-trace remainder. T6 (n=7, committed) sits apart on purity, but is small enough that no S/O coherence badge is shown for it.
Figure 25. Small multiples of all 7 topics at K=7. Purity has visibly degraded from the earlier rounds — six of the seven topics sit below the 80% bar, several well below 60%.
Figure 26. Topic T6 detail (K=7, n=7): 86% NC_only. Too small for a stable S/O coherence estimate. Committed to knowledge.
Figure 27. Knowledge base after Step 4: 17 groups committed, 897 of 1,050 traces (85.4%) explained so far; 153 traces remain.

Step 5 — UMAP + k-means (N=8) on the 153-trace residue

STEP 5With Step 4 yielding almost nothing, the session switched from topic purity to Stage 5's embedding + clustering approach on the 153-trace residue, the same decision point used in the Fines case study and in Step 5 of the earlier (buggy) run of this session. Topics were refit at K=6 purely as a feature space (not evaluated for purity in their own right), then UMAP-embedded and clustered with k-means swept across N=5–12, each time recording every cluster's size and outcome-homogeneity under a ≥0.80 / n≥6 rule.

Figure 28. Topics refit at K=6 on the 153-trace residue — used only as an input feature space for this stage's clustering, not evaluated for topic purity in its own right.
Figure 29. UMAP embedding of the 153-trace residue, colored by outcome. Several small, loosely separated clumps are visible but no single sharp partition.

Coverage under the purity rule was zero at N=5–7, then jumped to 42 of 153 traces (27.5%) at N=8 across three qualifying clusters — the best result in the sweep, ahead of every larger N tried (22–32 traces). N=8 was taken forward and re-fit directly (rather than read off the sweep) before committing.

Figure 30. The same 153-trace UMAP embedding, after running k-means at N=8, colored by cluster assignment (eight distinct colors) rather than by outcome. The automatic gold-dashed shape-detection overlay — a separate, lower-confidence “visual estimate” feature unrelated to this actual k-means result — has been turned off for this figure so the real clustering reads cleanly, and no manual box/lasso selection is active.
Figure 31. The N=8 k-means run's cluster table: three clusters clear the 0.80 purity bar — 14 traces at 85.7% no_admission, 13 at 84.6% IC_then_NC, and 15 at 80% NC_only — while the other five clusters, including one large 64-trace mixed “wastebasket” cluster at 35.9% homogeneity, stayed well below it.

The three qualifying clusters were committed directly from the cluster table. Notably, one of them — 13 traces, 84.6% IC_then_NC — is the first and only committed group across all four rounds whose dominant outcome is an escalation outcome rather than NC_only or no_admission; its fingerprint shows a distinctive profile (SIRS: respiratory rate true 92%, +35pp; IV infusion required true 100%, +24pp; a specific diagnosis code 54%, +48pp) that the topic-modeling rounds never isolated on their own.

Figure 32. Knowledge base after Step 5: 20 groups committed, 939 of 1,050 traces (89.4%) explained. 111 traces remain.

Final knowledge base and what was left unexplained

Table 1 lists every group committed during the session, in commit order, with its size, share of the full dataset, dominant outcome, and provenance.

#Descriptionn% of datasetDominant outcomePurityS · OSource / step
0Obvious group: ER Registration → ER Triage → ER Sepsis Triage353.3%no_admission100%– · 1.00obvious group (Step 1)
1Topic T0-dominant (K=18)24123.0%NC_only98.8%3.7× · 0.93topic (Step 2)
2Topic T1-dominant (K=18)20419.4%NC_only97.1%3.7× · 0.84topic (Step 2)
3Topic T2-dominant (K=18)878.3%no_admission97.7%4.1× · 0.88topic (Step 2)
4Topic T5-dominant (K=18)413.9%no_admission90.2%4.4× · 0.65topic (Step 2)
5Topic T7-dominant (K=18)424.0%NC_only95.2%4.1× · 0.76topic (Step 2)
6Topic T9-dominant (K=18)242.3%no_admission87.5%4.4× · 0.50topic (Step 2)
7Topic T10-dominant (K=18)333.1%NC_only87.9%3.2× · 0.52topic (Step 2)
8Topic T11-dominant (K=18)141.3%no_admission100%4.5× · 1.00topic (Step 2)
9Topic T12-dominant (K=18)272.6%NC_only92.6%4.1× · 0.66topic (Step 2)
10Topic T13-dominant (K=18)181.7%NC_only100%4.4× · 1.00topic (Step 2)
11Topic T14-dominant (K=18)141.3%NC_only92.9%3.8× · 0.72topic (Step 2)
12Topic T15-dominant (K=18)262.5%NC_only96.2%3.7× · 0.82topic (Step 2)
13Topic T17-dominant (K=18)141.3%NC_only100%4.5× · 1.00topic (Step 2)
14Topic T1-dominant (K=8)252.4%no_admission96%3.3× · 0.88topic (Step 3)
15Topic T2-dominant (K=8)454.3%NC_only82.2%3.1× · 0.54topic (Step 3)
16Topic T6-dominant (K=7)70.7%NC_only85.7%too small to scoretopic (Step 4)
17Homogeneous cluster: T1-dominant (N=8, K=6)141.3%no_admission85.7%2.5× · 0.72k-means cluster (Step 5)
18Homogeneous cluster: T2-dominant (N=8, K=6)131.2%IC_then_NC84.6%2.4× · 0.70k-means cluster (Step 5)
19Homogeneous cluster: T0-dominant (N=8, K=6)151.4%NC_only80%2.3× · 0.56k-means cluster (Step 5)
Total interpreted93989.4%

Table 2 breaks down the 111-trace residue by outcome, compared against its share of the whole dataset.

Outcomen in residue% of residue% of that outcome dataset-wide left unexplained
IC_then_NC3531.5%35 of 62 (56.5%)
NC_only3430.6%34 of 700 (4.9%)
NC_then_IC2623.4%26 of 38 (68.4%)
no_admission119.9%11 of 240 (4.6%)
IC_only54.5%5 of 10 (50.0%)
The two escalation outcomes — NC_then_IC (3.6% dataset-wide) and IC_then_NC (5.9%) — remain the least-captured in relative terms: 68.4% of all NC_then_IC traces and 56.5% of all IC_then_NC traces are still in the residue, alongside half of the rare IC_only outcome. This is a real improvement over the earlier (buggy) run of this session, which left 72.6% of IC_then_NC and 90.0% of IC_only unexplained — the corrected encoding, and in particular Step 5's escalation-dominant cluster (Table 1, row 18), captured meaningfully more of the escalation traces than the flawed run managed. Even so, no round's topic modeling ever produced a group dominated by an escalation outcome; only Step 5's clustering did, once. Escalation and ICU-involving trajectories in this log remain the hardest structure to carve out cleanly — a substantive finding about the dataset, not just a stopping point.

Takeaways for students

Always verify that a "recommended" setting was actually applied, not just displayed. This document exists because a reader reproduced this exact session and got different numbers back for Step 2 — because the original run's automation called the app's encoding scorer every round but never clicked through on what it recommended, so every fit silently used the plain default instead. The scorer's own recommendation table looked identical either way; only the actual switches, and the numbers downstream of them, differed. When a tool separates "compute a recommendation" from "apply it," treat that as two steps to verify, not one.
A rich, small dataset does not mean an easy one. Sepsis has a fifth of the Fines log's activity vocabulary and a fraction of its trace count, yet still left a meaningful residue after four rounds. Fewer traces means every subsequent round's remainder shrinks faster, and NMF and k-means both need enough traces per candidate group to distinguish "real structure" from "coincidence of a few cases" — small absolute residues (160, then 153 traces) run out of that headroom quickly, as Step 4's near-empty round shows directly.
The encoding recommender does not have to agree with itself, and that's informative too. Step 3's own top-ranked candidate was simpler than the encoding already active from Step 2 — a real, if easy to miss, signal that the richer encoding's advantage was concentrated in the traces already carved out, not universal. Keeping the existing encoding rather than mechanically narrowing it every round is a defensible choice, but it is a choice, and this document says so explicitly rather than papering over it.
Purity degrades unevenly as the remainder shrinks — sometimes sharply, not smoothly. Step 2's thirteen committed topics ranged 87.5–100% pure; Step 3's two, 82.2–96%; then Step 4 collapsed to a single 7-trace, 85.7%-pure topic with no reliable coherence score at all. Step 5's best cluster (85.7%) was purer than Step 4's only topic — a reminder that "later round" and "worse candidate" are correlated, not identical, and every candidate still needs to be checked on its own terms, including whether it's even large enough to score.
Not every outcome will yield a group, and that is a legitimate result. Across four rounds, only one committed group (Table 1, row 18) was ever dominated by an escalation outcome, and it took switching from topic modeling to clustering to find it. The rarest outcomes — IC_only (1.0% dataset-wide) and NC_then_IC (3.6%) — remain the least-captured even after the fix. Reporting that honestly (Table 2) is part of the method's output, not a failure of the analysis.