Skip to content
AI.info

ML data engineering

Capstone: Design and Defend an ML Evidence Platform

Design a complete ML data platform and defend its evidence contracts, failure handling, and release decisions.

By the end you can

The scenario: real-time account takeover detection

A multinational marketplace wants one evidence platform. It has to carry account-takeover detection, seller-risk review, recommendations, and operational forecasting at once. That means batch training, low-latency features, delayed outcomes, streaming corrections, graph relationships, and regional privacy constraints on the same foundation.

You are not asked to choose one fashionable architecture. You must show which decisions share infrastructure, which semantics remain domain-owned, and how the system behaves when evidence is late, missing, disputed, poisoned, deleted, or too expensive to recompute.

Each of those failures has already happened to somebody, on the record, with a docket number. Four of them grade this capstone. Knight Capital Americas, on 1 August 2012. The 2017 Equifax breach, as the Government Accountability Office reconstructed it. The Horizon accounting records examined in Bates & Others v Post Office Ltd. And SyRI, the Dutch fraud-scoring system struck down by the District Court of The Hague on 5 February 2020.

The capstone succeeds when every training row and serving feature can be defended as legitimate evidence for the decision.

Visual

The design must connect five planes

Strong architectures show the interfaces and guarantees between five planes. The decision plane names the request, latency, subject, action, threshold owner, and fallback. The evidence plane holds events, dimensions, labels, identities, clocks, exposure, and permitted history. The pipeline plane covers ingestion, storage, joins, transformations, materialization, and snapshots. The assurance plane carries contracts, validation, temporal tests, parity, observability, incidents, and rollback. The governance plane governs purpose, minimization, access, retention, deletion, documentation, and approvals.

The failures later in this lesson are each a break in one plane that arrived through another. A deployment procedure that did not exist cost Knight Capital $460 million in about 45 minutes; that is the assurance plane. A certificate that had expired roughly 10 months earlier hid an intrusion at Equifax; assurance again. Legislation that could not be inspected ended SyRI; that one is governance. None of the three shows up in a training table.

FigureHierarchy · 5 levels
  • Decision plane

    Prediction request, latency, subject, action, threshold owner, and fallback.

    • Evidence plane

      Events, dimensions, labels, identities, clocks, exposure, and permitted history.

      • Pipeline plane

        Ingestion, storage, joins, transformations, feature materialization, and snapshots.

        • Assurance plane

          Contracts, validation, temporal tests, parity, observability, incidents, and rollback.

          • Governance plane

            Purpose, minimization, access, retention, deletion, documentation, and approvals.

The model consumes outputs from all five planes, even when only the evidence plane appears in the training table.

Comparison

Three architectural starting points

Choose the smallest design that satisfies the decision and recovery requirements. A nightly batch system is simple and reproducible. It remains the right home for labels, long-history features, and backfills, and it cannot meet rapidly changing device-risk needs. A streaming-only system gives low latency for recent behavior, then makes replay, correction, and historical joining hard; reference data and labels still need batch paths. A hybrid evidence system uses event streams for fresh state and batch snapshots for history, labels, and reconciliation. It fits mixed latency and correction needs. It also adds coordination between the two paths, and that coordination has to be tested rather than assumed.

FigureComparison · 3 columns

Nightly batch system

Build snapshots and current features once per day.

  • Simple and reproducible
  • Cannot meet rapidly changing device-risk needs
  • Useful for labels, long-history features, and backfills
  • Likely one component, not the complete solution

Streaming-only system

Derive all features continuously from events.

  • Low latency for recent behavior
  • Complex replay, correction, and historical joining
  • Reference data and labels still need batch paths
  • Risk of forcing every feature into streaming state

Hybrid evidence system

Use event streams for fresh state and batch snapshots for history, labels, and reconciliation.

  • Matches mixed latency and correction needs
  • Requires clear source-of-truth and parity contracts
  • Supports point-in-time training and online freshness
  • Adds coordination that must be tested explicitly

Steps

Part 1: write the example and label contract

Do this before drawing technology boxes. Define the example grain and a unique prediction key. Fix the event, server, and availability clocks used at login or payment time. Separate confirmed takeover from confirmed legitimate, and both from unknown and censored cases. Record which cases received review, and which model score influenced that review. Keep accounts and linked identities together in the split.

Step 3 is the one teams treat as a free choice. For a consumer account-takeover or fraud platform it is not one. The label-arrival clock is written into Regulation E. Under 12 CFR § 1005.11 the consumer has until 60 days after the institution sends the periodic statement to give notice of an error. From that notice the rule runs: “A financial institution shall investigate promptly and, except as otherwise provided in this paragraph (c), shall determine whether an error occurred within 10 business days of receiving a notice of error.” The institution may take up to 45 days instead, if it provisionally credits the account within 10 business days.

The extensions are asymmetric, and the split protocol has to encode them. Those windows become 20 business days and 90 days for transfers not initiated within a state, point-of-sale debit card transactions, and accounts opened within the previous 30 days. Bank examiners are told the same thing. The Federal Deposit Insurance Corporation states it in its examination manual: notice “not later than 60 days after sending a periodic statement”, and “the time periods are extended from 10 and 45 days, to 20 and 90 days, respectively”. So a training table cut today holds a knowable population of cases that are still legally open. It also holds a new-account cohort whose labels mature on a different schedule from everyone else's.

FigureProcess · 5 steps
  1. 1. Define the example

    Choose account, event, or account-event grain and a unique prediction key.

  2. 2. Fix the cutoff

    State event, server, and availability clocks used at login or payment time.

  3. 3. Define outcomes

    Separate confirmed takeover, confirmed legitimate, unknown, and censored cases.

  4. 4. Map selection

    Record which cases receive review, which model score influenced review, and which random audits exist.

  5. 5. Set split protocol

    Keep accounts and linked identities together while evaluating future periods and regions.

Label maturity is set by 12 CFR § 1005.11 before it is set by the training schedule: the design must carry delayed confirmation, censored cases, and model-influenced investigation.

Steps

Part 2: design sources, identity, and temporal features

Every feature must have a source, owner, timestamp, and online availability story. Inventory the events and dimensions with their authority, contracts, coverage, corrections, and privacy classification. Resolve identities temporally, without rewriting historical ownership. Separate streaming state for recent events from batch sources for stable long history. Reconstruct only values that were available before each historical scoring request. Then specify missing-device, stale-cache, cold-start, and source-outage behavior.

Banking supervisors wrote this expectation down in January 2013. The Basel Committee asks that risk data “be aggregated on a largely automated basis so as to minimise the probability of errors”. A bank “should strive towards a single authoritative source for risk data per each type of risk”. Its completeness principle asks a bank to “capture and aggregate all material risk data across the banking group”. One source per risk, assembled by machine, with nothing material left out. That is a source inventory, written by a regulator.

FigureProcess · 5 steps
  1. 1. Inventory events and dimensions

    List authority, contracts, coverage, corrections, and privacy classification.

  2. 2. Resolve identities temporally

    Map account, customer, session, and device IDs without rewriting historical ownership.

  3. 3. Separate fresh and historical features

    Use streaming state for recent events and batch sources for stable long history.

  4. 4. Build point-in-time retrieval

    Reconstruct only values available before each historical scoring request.

  5. 5. Define fallbacks

    Specify missing-device, stale-cache, cold-start, and source-outage behavior.

Online fallbacks should be represented during training and evaluation rather than treated as exceptional production details.

Steps

Part 3: publish datasets and operate pipelines

The architecture should support safe retry, backfill, comparison, and rollback. Preserve raw evidence and immutable training releases. Make jobs idempotent, with stable keys and atomic publication boundaries. Version the online and offline materialization. Keep manifests linking sources to consumers. Document the recovery path.

Step 5 is where an architecture is actually tested, and Knight Capital Americas is the case to design against. On 1 August 2012 a staged manual deployment skipped one of eight SMARS routing servers, leaving obsolete “Power Peg” code active there. In about 45 minutes the firm took 4 million executions in 154 stocks for more than 397 million shares, and realised a $460 million loss. The instructive part is not the bad release. It is the recovery attempt, which the SEC set out like this: “In one of its attempts to address the problem, Knight uninstalled the new RLP code from the seven servers where it had been deployed correctly. This action worsened the problem, causing additional incoming parent orders to activate the Power Peg code that was present on those servers, similar to what had already occurred on the eighth server.”

The SEC's order came on 16 October 2013. It fined Knight $12,000,000, and found that the firm had no written code deployment procedures and no requirement for a second technician to review a deployment. The Federal Reserve Bank of Chicago described the same morning from outside the firm: “On Wednesday, August 1, 2012, a $440 million loss in 45 minutes brought market maker Knight Capital to the brink of bankruptcy”. Its author, Carol Clark, listed the controls that were absent — order-rate limits, a kill switch, intraday position limits and profit-and-loss limits. Your recovery plan must therefore state, before an incident, which action contains and which action spreads. And no partial rollout may reach production without a second reviewer recorded in the manifest.

FigureProcess · 5 steps
  1. 1. Choose storage and snapshots

    Preserve raw evidence, canonical events, temporal dimensions, and immutable training releases.

  2. 2. Define idempotent jobs

    Set logical intervals, stable keys, checkpoints, and atomic publication boundaries.

  3. 3. Coordinate materialization

    Version online and offline features, freshness, TTL, and rollout order.

  4. 4. Build manifests and lineage

    Link sources, jobs, runs, features, datasets, models, and consumers.

  5. 5. Plan recovery

    Document containment, replay, backfill, rollback, and consumer notification.

Knight's rollback removed the new code from the seven servers where it had worked and made the incident worse: an untested recovery path is part of the failure, not the fix.

Example

Required quality and leakage gates

The release plan should include concrete controls with owners and responses. Two of these gates have documented body counts, and the bullets name them.

  • Identity gate: no unexpected many-to-many mapping, and device or account merge changes stay within temporal validity intervals.
  • Temporal gate: every historical feature availability time is at or before the scoring cutoff.
  • Label gate: censored cases remain unknown, guideline versions are preserved, and reviewed-case selection is measured — with the 10-business-day, 45-day, 20-business-day and 90-day windows of 12 CFR § 1005.11 recorded per case rather than assumed uniform.
  • Parity gate: replayed online requests match offline feature reconstruction for keys, values, defaults, and freshness.
  • Coverage gate: event and feature availability are monitored by region, application version, device family, and cold-start status — and the monitoring is itself monitored. At Equifax a digital certificate that had expired roughly 10 months before the breach meant encrypted traffic was never inspected: “The attack lasted for about 76 days before it was discovered.”
  • Publication gate: the new snapshot is atomic, validated, diffed, documented, and connected to rollback evidence. Knight Capital's 1 August 2012 release reached seven of eight SMARS servers. There was no written code deployment procedure and no second technician required to check it, and the SEC's order of 16 October 2013 fined the firm $12,000,000.

Steps

Part 4: secure and govern the evidence lifecycle

Extend the architecture beyond quality and throughput. Threat-model the sources. Define the privacy flows. Publish the documentation. Design retirement.

Some of this is now a legal requirement. Article 10(3) of the EU AI Act covers the training, validation and testing data sets of high-risk systems. They “shall be relevant, sufficiently representative, and to the best extent possible, free of errors”. The same paragraph asks for “the appropriate statistical properties”, including for the groups affected. Representativeness is judged against the intended purpose, never in the abstract.

Step 1 has a price list. Nicholas Carlini and eight colleagues showed how cheap it is to poison a slice of a web-scale training set. They presented the work at the IEEE Symposium on Security and Privacy in 2024: “By exploiting specific invalid trust assumptions, we show how we could have poisoned 0.01% of the LAION-400M or COYO-700M datasets for just $60 USD.” NIST's adversarial machine learning taxonomy, published in March 2025, cites that work and names the countermeasure: “For preventing data poisoning with web-scale data dependencies, this includes verifying web downloads as a basic integrity check to ensure that domain hijacking has not injected new sources of data into the training dataset”. Poisoning is not a line on a risk register, then. It is an acceptance test: every externally fetched source verified against a hash published by the publisher.

The same step covers controls that fail silently rather than loudly. Attackers reached the personal information of at least 145.5 million individuals through Equifax's online dispute portal — the finding of a Government Accountability Office report published on 30 August 2018. The Federal Trade Commission settled on 22 July 2019, requiring Equifax to pay at least $575 million. The settlement alleged that “Equifax failed to patch its network after being alerted in March 2017 to a critical security vulnerability affecting its ACIS database”. The company's own security team had ordered vulnerable systems patched within 48 hours. A control that exists on paper and sees nothing for ten months is worse than a missing one. It gets credited in the design review.

Step 2 has a stop condition with a date on it. On 5 February 2020 the District Court of The Hague ruled on SyRI (Systeem Risico Indicatie), a system that linked government databases to score citizens for benefit and tax fraud. The court held that the enabling legislation did not strike the “fair balance” required by Article 8 ECHR. It declared Section 65 of the SUWI Act and Chapter 5a of the SUWI Decree to have no binding effect. A privacy flow that cannot be inspected by the people scored through it has already been held unlawful once — for a platform doing the work this capstone describes.

FigureProcess · 4 steps
  1. 1. Threat-model sources

    Identify manipulation, disclosure, poisoning, and dependency risks.

  2. 2. Define privacy flows

    Map purpose, consent, retention, deletion, and regional restrictions.

  3. 3. Publish documentation

    Create release manifests, datasheets, access decisions, and limitations.

  4. 4. Design retirement

    Explain how datasets, features, and consumers are deprecated and removed.

Steps

Part 5: justify platform boundaries and cost

Decide which mechanisms should be shared and which remain domain-specific. Model the workload first: scan, shuffle, state, online serving, labeling, and backfill demand. Compare batch, streaming, feature-store, and hybrid options under failure, not under happy-path throughput. Then price the whole lifecycle, including migration, incidents, retention, recovery, and human review. Knight's $460 million in about 45 minutes and Equifax's settlement of at least $575 million are lifecycle costs of the assurance and governance planes. They are not line items outside the platform budget. Last, preserve reversibility: state the portability, exit, fallback, and rollback conditions before the first dependency is created.

FigureProcess · 4 steps
  1. 1. Model workload

    Estimate scan, shuffle, state, online, labeling, and backfill demand.

  2. 2. Compare architectures

    Evaluate batch, streaming, feature-store, and hybrid options under failure.

  3. 3. Price lifecycle

    Include migration, incidents, retention, recovery, and human review.

  4. 4. Preserve reversibility

    State portability, exit, fallback, and rollback conditions.

Key idea

Make tradeoffs explicit rather than hiding them in defaults

Retaining raw device evidence improves debugging and backfills, and it increases privacy and security risk. Aggressive minimization may leave investigators unable to reconstruct what happened. State the chosen balance and the approved retention.

Fresh streaming features respond faster, and they make replay and parity harder. Decide which features genuinely need sub-minute updates and which can remain batch.

Random audit labels improve coverage and feedback-loop analysis, and they consume review capacity. Define a sustainable exploration budget and how it affects operations.

The design should name costs, risks, rejected alternatives, and the evidence that would justify a later redesign.

A gold-standard architecture documents the tradeoffs it accepts, not only the capabilities it provides.

The capstone deliverable set

Produce an example and label specification, source inventory, event and data contracts, architecture diagram, temporal-feature specification, and split protocol.

Add a dataset release manifest, feature registry entries, validation matrix, service objectives, incident runbook, backfill plan, and privacy datasheet.

Include three adversarial timelines that prove future values are excluded. Include three source failures, and show containment, fallback, and recovery for each. Make one of them the Knight sequence, in which the rollback itself is the accelerant. Then the runbook has to say which action contains and which spreads.

Finish with a decision record. It should explain why the chosen architecture is sufficient, which assumptions remain uncertain, and which measurements will decide where the next money goes.

The capstone is complete when another team can implement, test, operate, and challenge the design without relying on oral explanation.

Analogy

The final design stands up in an evidence court

Courts decide cases from admissible evidence. Each item needs provenance, timing, chain of custody, interpretation, and rules about what may be considered. The example contract defines the case. Point-in-time logic determines admissibility, lineage preserves chain of custody, and validation challenges unreliable evidence. Governance restricts how sensitive evidence can be used.

This is not only a metaphor. A court has already ruled on whether the output of an accounting system was reliable evidence of a shortfall. In December 2019, in Bates & Others v Post Office Ltd, the High Court found that bugs, errors and defects in the Horizon accounting system had in fact caused discrepancies in subpostmasters' branch accounts “on numerous occasions”. It found “a significant and material risk of inaccuracy in branch accounts”. It found that Horizon did not alert subpostmasters to those defects. Fraser J's answer to Horizon Issue 3 is one sentence long: “In summary terms only, Legacy Horizon was not remotely robust.”

The consequence then ran the other way through the same evidence. In April 2021 the Court of Appeal, in Hamilton & Ors v Post Office Ltd, applied those findings to prosecutions that had rested on Horizon data. The judgment “concerns forty-two men and women who were employed by Post Office Limited”. It quashed thirty-nine convictions in the “Horizon cases” — those in which the reliability of Horizon data was essential to the prosecution — and dismissed the three remaining appeals, where that reliability was not essential. ML decisions happen at scale, and they can influence the evidence that arrives next. So the system must monitor feedback and revise the measurement process continuously.

Horizon output was treated as evidence for years before a judge wrote that it “was not remotely robust”; traceability is what lets that challenge arrive earlier.

A final review before implementation

Ask whether the design can answer one prediction end to end. Which raw events produced each feature? Which versions and clocks were used? What happens when one source is absent?

Ask whether offline metrics could still be inflated. Test reviewed-case selection, identity overlap, future corrections, current-state joins, split contamination, and synthetic derivatives.

Ask whether operations are recoverable. The system should survive duplicate delivery, partial failure, stale materialization, a bad schema release, and a historical backfill. It should also survive the recovery action itself, which at Knight Capital removed the new code from seven correctly deployed servers and made the loss larger.

Finally, ask whether the dataset should exist in its proposed form. Verify purpose, minimization, access, retention, deletion, and documentation before anyone builds it and creates irreversible data dependencies. On 5 February 2020 the District Court of The Hague answered that question for a system already in production: “The court holds that the legislation pertaining to the application of SyRI is insufficiently transparent and verifiable.” Section 65 of the SUWI Act and Chapter 5a of the SUWI Decree were declared to have no binding effect. The stop condition is real, it has a citation, and it is cheaper to apply before the platform is built.

The strongest final design is not the largest; it is the smallest system that can defend its evidence and recover from its failures.

The final submission is a decision memo, not an architecture poster

The memo should name the decision contracts, source authorities, temporal rules, identity model, label maturity, data releases, online evidence path, quality gates, SLIs, security controls, governance conditions, and cost model.

Include rejected alternatives, unresolved risks, responsible owners, staged rollout, stop conditions, and the evidence that would justify redesign. A valid conclusion may be to avoid real-time processing altogether, or to keep one domain outside the shared platform.

Write the stop conditions in the form the record supports. What would make this platform unlawful to inspect, as SyRI was held to be on 5 February 2020? What would make its records unusable as evidence, as Legacy Horizon was found to be? And who is required to approve a partial deployment — which at Knight was nobody?

A gold-standard design makes uncertainty, tradeoffs, and accountability reviewable.

Key takeaways