Claims 2: Claims With a Member
Requires Pro (Import, and the imported person-model.xml uses PersonAssembler and FlatFile)
Problem statement
Lesson 1’s model tells you how many claims happened and how large they were, but nothing about who they happened to. Real claims analytics almost never stops at aggregate counts and amounts — you need to roll claims up by policyholder, look for members with unusual claim patterns, or join claims data against a completely separate system that only knows how to key on a person. None of that works if “who” isn’t part of the observation at all.
The model
SpiceGrinder Pro already ships a full synthetic-identity business object: samples/pro/person-model.xml. It’s worth looking at directly — a PersonAssembler (a small custom filter) combines a 50/50 Mix over gender with a matching given-name FlatFile lookup (SSA top-100 names) and a separate surname FlatFile lookup (US Census top-100 surnames), so gender and given name always agree while the two name components vary independently.
Rather than copy any of that into the claims model, Import it — the same tool the Vitals lessons used to reuse vitals-lib.xml.
<?xml version="1.0" encoding="UTF-8"?>
<dataset columns="member, claimCount, severity" seed="42">
<root node="ClaimObservation"/>
<nodes>
<Append name="ClaimObservation">
<input name="Member"/>
<input name="Frequency"/>
<input name="Severity"/>
</Append>
<Import name="Member" file="person-model.xml"/>
<Poisson name="Frequency" lambda="3.5"/>
<Lognormal name="Severity" mu="8.0" sigma="1.2"/>
</nodes>
</dataset>
One new <input>, one new Import line — nothing about Frequency/Severity changed. Run it and each observation is now a full row: who, plus what happened to them.
Catherine Ortiz,5,7411.46203012888
Kevin Cruz,2,15323.028678898674
Randy Phillips,3,13875.965680698899
Christopher White,1,1320.8613862135312
Cheryl Bailey,6,5546.455493342504
Jacqueline Richardson,4,5809.677891177162
Alice Smith,1,1940.0335823135702
Frances Sanders,2,7375.552486392491
The counts and amounts are exactly the rows Claims 1 printed: each node draws from its own random stream, named by the seed and the node’s name, so adding the member didn’t shift Frequency or Severity at all. The member prints as a full name. Its gender, given name and surname are still separate fields inside it, and Extract can split them into their own columns (fields="givenName,surname,gender") when a downstream system wants them apart.
Reading this as a claim record, not a coincidence
Notice that frequency and severity are drawn completely independently of who the member is — that’s a simplification we’re using for this lesson. A real book of business often does have correlation between policyholder attributes and claim behavior; nothing stops you from modeling that (a Mix over member cohorts, the same technique the Vitals lessons used for the anomalous-reading population, is a natural next step).
This lesson is narrower than that. We’re just showing that a complex data type like an identity composes into a claim record the way any other input does, with Append never caring whether an input is a statistical distribution or an entire imported business object.