BatterySwapAI 2026 β EML symbolic-regression RUL model
A submission for the
BatterySwapAI 2026 challenge,
built on the official example layout. The Remaining-Useful-Life model is a
closed-form symbolic expression discovered with SymbolicRegression.jl over the
EML primitive eml(x, y) = exp(x) - ln(y), ported 1:1 from the Julia pipeline
and wired into the competition RULModel / Planner interfaces.
batteryswap_example/train.pyβ the EML feature pipeline + fitted expression,EMLRULModel(implementsRULModel),OrderedPlanner(implementsPlanner), and the pickle builder. All classes referenced by the pickle live here so thatscript.py'sfrom batteryswap_example.train import *resolves them at load.batteryswap_example/planners/best.pickleβ the trained planner (generate it with the command below, then commit it).script.py,Dockerfile,requirements.txtβ unchanged from the example.
The RUL model is deterministic and has no learned parameters, so fit is a
no-op and the pickle can be regenerated without the dataset. RUL is returned in
days relative to the planning instant (the fitted expression emits hours;
predict divides by 24).
Setup
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt -r requirements.dev.txt
Generate the submitted planner
Run from the repository root so the pickled classes get the canonical module
path batteryswap_example.train.* (this is how script.py imports them):
python -c "from batteryswap_example.train import main; main()"
This writes batteryswap_example/planners/best.pickle. If BATTERYSWAP_DATASET_PATH
points at a local dataset, it also prints per-scenario scores as a sanity check.
Commit the pickle.
Test the submission in Docker (recommended)
Mirrors the competition runtime exactly.
docker build -t batteryswapai-2026-eml .
docker run --name batteryswapai -v ./dataset:/tmp/data batteryswapai-2026-eml \
bash -c "/app/env/bin/python3 script.py && /app/env/bin/python3 -m batteryswap_public.metric"
docker cp batteryswapai:/app/submission.csv ./submission.csv
Submit
Commit and push to your HuggingFace model repository, then use New submission in the competition application.
Notes / next steps
OrderedPlanner.safety_margin_daysshifts predicted EOL earlier β a first, blunt handle on the downtime-dominated asymmetric cost (newsvendor Ξ΄*). Set to 0.0 to reproduce the example baseline.- Part 2 (fleet scheduling: co-location batching, travel costs, worker-day
limits) replaces
OrderedPlanner. The runtime shipsortoolsandlifelines. - To produce genuine quantiles (for a newsvendor-conservative plan), replace the
point prediction in
EMLRULModel.predictwith your Monte-Carlo RUL distribution and select the target quantile.