--- title: Build your own decision rule review-state: drafting last-human-review: "2026-06-10" depends-on: - src/pytyche/experiment/recommendation.py owner: tradcliffe quadrant: how-to --- # Build your own decision rule :::{admonition} Placeholder — not yet written :class: note The full recipe — implementing a custom `GraduationRule` to replace the default `ExpectedLossRule` in sequential experiments — is coming in a future release. ::: This guide will cover how to implement the `GraduationRule` protocol so you can substitute your own stopping criterion into pytyche's sequential experiment loop. Custom rules let you encode bespoke business constraints (budget guardrails, time-to-decision caps, asymmetric loss functions) that the built-in `ExpectedLossRule` does not express. ## What exists today `GraduationRule` implementations are passed to `pt.sequential_experiment(graduation_rule=...)`; the default is `ExpectedLossRule`. The decision-theoretic quantities a custom rule consumes come from `posterior.recommendation_summary(...)` and the per-segment fields on `DiscoveredSegment`. For the decision-theoretic foundations — what each input means and when to trust it — see the [decision-theoretic inputs](../concepts/decision-theoretic-inputs.md) concept doc.