NeoLDM · 03 — cortex embeddings¶
cortex's per-transaction hidden state, fed to the same XGBoost, on the full test:
Embeddings: embeddings.neospace.ai (finetune split).
In [1]:
import json
m=json.load(open('results/fulltest_finetune.json')); t=m['test']
print(f"full test ({t['rows']:,} rows, {t['fraud']:,} fraud):")
labels={'raw_13d':'raw','finetune_hidden':'cortex','raw+finetune_hidden':'cortex + raw'}
for k,v in m['arms'].items():
print(f" {labels.get(k,k):22s} AUPRC {v['auprc_mean']:.3f} ± {v['auprc_std']:.3f} ({v['auprc_mean']/t['rate']:.0f}x random) F1 {v['f1_mean']:.3f}")
raw=m['arms']['raw_13d']['auprc_mean']; comb=m['arms']['raw+finetune_hidden']['auprc_mean']
print(f"\n raw {raw:.3f} -> cortex + raw {comb:.3f} ({comb/raw:.1f}x)")
full test (2,412,326 rows, 2,698 fraud): raw AUPRC 0.176 ± 0.034 (157x random) F1 0.301 cortex AUPRC 0.896 ± 0.034 (801x random) F1 0.870 cortex + raw AUPRC 0.955 ± 0.007 (854x random) F1 0.906 raw 0.176 -> cortex + raw 0.955 (5.4x)
Note¶
- AUPRC 0.955 — 854× random, 5.4× the raw baseline.
- cortex alone reaches 0.896 (801× random); adding the raw features on top lifts it to 0.955.
