# Interactive scheduling example
Change the drift scenario, training price and quality weight to see **when to retrain and how much data to use**. The page compares an optimized schedule with three fixed policies: retrain every six steps, always retrain, or never retrain. Bars show retraining times and the amount of data used; the cost chart separates training cost from weighted prediction loss. ## What the example computes The page displays 60 precomputed cases generated by the actual `RetrainingPlanner(...).plan("exact")` through its public evaluator interface. The inputs are synthetic cost tables, not fitted models or paper measurements. The exact planner sees the whole timeline in advance. Its result is optimal over the supplied finite choices, not a guarantee about future deployment. Each case has 24 steps and 100 available samples per retraining step. The optimizer chooses among 25, 50, 75 and 100 samples. All policies start at step zero with the same existing full-data model, whose training is not charged. Retraining starts from step one. The fixed policies always use all 100 samples; the six-step interval is fixed before planning, not selected in hindsight. For regime values $z_t$, a model last trained at $s$, and data fraction $v$, the toy loss is $$L(t;s,v) = 0.04 + 0.85|z_t-z_s| + 0.12(1-v) + 0.04(t-s)/23.$$ With training-price multiplier $p$, a new fit has cost $$C(t,v) = p(0.08 + v^{1.8})(0.9 + 0.2t/23).$$ The objective is the sum of training costs plus quality weight times the sum of losses. These are arbitrary demo units, not seconds or currency. A cost table entry is rounded to eight decimal places for reproducible generation. The browser displays precomputed results generated by the Python package. ## Reproduce the page data From a repository checkout with its package installed: ```shell python examples/build_demo.py python examples/build_demo.py --check ``` The first command writes `docs/_static/demo/data.json`; the second recomputes the cases and fails if the stored artifact differs. Generation needs only the core package and the Python standard library. The artifact records the package version and contains no wall-clock measurements or machine-specific paths. The page has no CDN, external fonts or runtime dependencies. Build the [documentation](development.md) to preview it with working guide links, or serve the demo directory directly: ```shell python -m http.server 8000 --directory docs/_static/demo ``` Open `http://localhost:8000` for the interactive page. Guide links require the built documentation site. To plan with your own data, continue with the [Python quick start](quickstart.md) and [cost and evaluator guide](evaluation.md).