A grammar of machine learning. Split, fit, evaluate, assess — in Python and R.
Every ML textbook distinguishes validation from test. 294 published papers don't (Kapoor & Narayanan, 2023). ml makes the mistake inexpressible.
import ml
s = ml.split(data, "churn", seed=42)
model = ml.fit(s.train, "churn", seed=42)
ml.evaluate(model, s.valid) # iterate freely
ml.assess(model, test=s.test) # once — second call errorsSame four verbs in R (ml_fit, ml_assess).
Same Rust engine underneath. Same result.
Beyond the core four: screen algorithms, tune hyperparameters, stack ensembles, validate against deployment rules, monitor drift in production. 11 Rust-native algorithms, 38 verbs, 173 bundled datasets.
| Install | Docs | |
|---|---|---|
| Python | pip install mlw |
python/ |
| R | remotes::install_github("epagogy/ml", subdir="r") |
r/ |
Roth, S. (2026). A Grammar of Machine Learning Workflows. doi:10.5281/zenodo.19023838
MIT. Simon Roth, 2026.