Skip to content

feat(examples): add a runnable ML training example - #1039

Open
remsky wants to merge 1 commit into
apache:mainfrom
remsky:ml-training-example
Open

remsky wants to merge 1 commit into
apache:mainfrom
remsky:ml-training-example

Conversation

@remsky

@remsky remsky commented Nov 11, 2026 •

Copy link
Copy Markdown

This PR replaces the placeholder ML training example with one that runs.

Covers both items in 138: epoch-based training and a human review.

Closes #138

Changes

examples/ml-training/application.py trains a scikit-learn model:

  • One epoch is one action, with a checkpoint for each epoch.
  • The stop rule is a transition condition.
  • The run halts before human_review and takes the decision as an input.
  • With continue, the reviewer can pass a new learning_rate.
  • A SQLite persister lets a new process resume the run by app_id.

Around it:

  • The required example files (notebook, README, diagram, requirements.txt) and a test.
  • ml-training is no longer in the skip list in validate_examples.py.
  • The docs page describes the new example and drops the WIP notice.
  • CI: one step in validate-examples installs the requirements of the example and runs its test.

How I tested this

  • Clean install of Burr 0.42.0 from requirements.txt: the test, a terminal run with stop and resume, notebook all passed.
  • Source tree: pre-commit (without frontend-lint-staged, no UI file changed) and validate_examples.py passed.
  • Windows with Python 3.12 only.

Notes

  • I used scikit-learn so that the example is lightweight. Let me know if you'd rather I swap to PyTorch.
  • The CI step is there because .[tests] does not include scikit-learn. I can remove it if you prefer.
  • docs: fix dead Lightning callbacks and cortex links #1009 edits the README and the docs page of this example; if it merges first it should only be a small mechanical conflict.

Follow-up if you'd want it: would be pretty clean to drop in an agent action that reads the summary and picks the next learning rate. The human-in-the-loop would then update the agent's instructions or approve the final model.

Checklist

  • PR has an informative and human-readable title (this will be pulled into the release notes)
  • Changes are limited to a single goal (no scope creep)
  • Code passed the pre-commit check & code is left cleaner/nicer than when first encountered.
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future TODOs are captured in comments
  • Project documentation has been updated if adding/changing functionality.

@github-actions github-actions Bot added area/website burr.apache.org website area/ci Workflows, build, release scripts area/examples Relates to /examples labels Nov 11, 2026
@remsky remsky mentioned this pull request Nov 11, 2026
2 tasks

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Workflows, build, release scripts area/examples Relates to /examples area/website burr.apache.org website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ML Training Example

1 participant