fraudtwin.label_observation#
Label availability and observation histories.
Status: Stable
Functions#
|
Apply a deterministic observation policy without mutating source records. |
|
Return the immutable versions in validated chronological order. |
|
Return the validated M17 policy from either a run or policy config. |
|
Validate references, ordering, and immutable truth invariants. |
|
Resolve the latest label version available at a prediction timestamp. |
Detailed API#
Deterministic, append-only observation of latent fraud labels.
- fraudtwin.label_observation.apply_label_observation(config, fraud_records, payments, *, customers=(), alerts=(), seed=None, simulation_run_id=None)[source][source]
Apply a deterministic observation policy without mutating source records.
- Return type:
tuple[tuple[LabelObservation,...],tuple[FinalObservedLabel,...]]- Parameters:
config (SimulationRunConfig | LabelObservationConfig)
fraud_records (Iterable[FraudRecord])
payments (Iterable[Payment])
customers (Iterable[Customer])
alerts (Iterable[FraudAlert])
seed (int | None)
simulation_run_id (str | None)
- fraudtwin.label_observation.reconstruct_label_history(observation)[source][source]
Return the immutable versions in validated chronological order.
- Return type:
tuple[LabelVersion,...]- Parameters:
observation (LabelObservation)
- fraudtwin.label_observation.resolve_label_observation(config)[source][source]
Return the validated M17 policy from either a run or policy config.
- Return type:
LabelObservationConfig- Parameters:
config (SimulationRunConfig | LabelObservationConfig)