Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python License Status

Surrogate CAN Energy — Surrogate modeling of vehicle energy consumption from CAN-like signals

Predict instantaneous vehicle energy consumption rate (kW) from multivariate CAN-like sensor time series (speed, accel, rpm, torque, throttle, gear, road grade). This repository is a reproducible, report-ready pipeline that generates artifacts (CSV, LaTeX tables, PDF figures) automatically and composes a LaTeX report that reads those artifacts directly.

Repository: https://github.com/salarsadek/surrogate-can-energy
Author: Salar Sadek


Report & key figures

Random Forest: Observed vs Predicted (test set)
RF Observed vs Predicted

Permutation importance (top engineered signals)
Permutation importance

Project highlights

  • Leakage-safe train/test splitting at the trip level to avoid temporal leakage.
  • Physically motivated feature engineering (speed², torque×RPM power proxy, grade×speed interaction).
  • Strong tabular baselines: Ridge and Random Forest (static features) plus rolling-window feature baselines.
  • A sequence experiment using GRU (included for comparison).
  • Uncertainty quantification (UQ) via ensemble spread + split conformal prediction.
  • Interpretability via permutation importance and partial dependence plots (PDPs).
  • Reproducible pipeline: scripts save models, tables, and figures under outputs/ and the LaTeX report reads them automatically.

Example results (from a demo synthetic run)

These numbers are example outputs from the included synthetic demo dataset to illustrate expected artifacts.

Model (test set) RMSE
Ridge (static) 84.13 0.889
Random Forest (static) 7.03 0.999
Ridge (windowed) 87.10 0.897
RF (windowed) 19.67 0.995
GRU (keras experiment) 222.34 0.329

Key takeaway: on this synthetic dataset, engineered tabular features + Random Forest give a very strong baseline; the GRU sequence model did not improve performance for this target (suggests short-horizon / largely memoryless structure).


Quickstart (Windows PowerShell)

  1. Clone repository (if not already):
git clone https://github.com/salarsadek/surrogate-can-energy
cd surrogate-can-energy


### 1. Create & activate a virtual environment
From the project root:
```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements.txt


### Folder structure
surrogate-can-energy/
  ├── config/                 # YAML configuration
  ├── data/
  │   ├── raw/                # raw inputs (ignored by git)
  │   └── processed/          # processed splits + engineered features
  ├── outputs/
  │   ├── figures/            # PDFs for report (optionally PNG previews)
  │   ├── tables/             # CSV + LaTeX tables
  │   └── models/             # saved models (ignored by git)
  ├── report/
  │   └── main.tex            # report (reads outputs/*)
  ├── src/
  │   ├── scripts/            # pipeline steps
  │   └── utils.py            # common utilities
  ├── tests/                  # sanity checks
  ├── run_all.ps1             # end-to-end runner (Windows)
  ├── Makefile                # convenience targets
  └── requirements.txt

About

Reproducible surrogate modeling pipeline for vehicle energy consumption using CAN-like signals, with UQ and interpretability.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages