How tamu-esp/ring_bp_python works
Project type and purpose
• This is a data-science/ML pipeline in Python for building Bio-impedance (Bio-Z) to blood-pressure (BP) regression models.
• It ingests precomputed features and BP values (in a MATLAB .mat file), performs windowed averaging, and runs two modeling workflows: a subject-specific regression and a leave-one-subject-out regression.
File structure
Top-level files and scripts:
• Feature_and_BP_Subject_Data.mat – Input data store (features + BP labels)
• window_average.py – Preprocessing step (sliding-window averaging)
• subject_specific_regression.py – Workflow #1: Train/evaluate per-subject models
• leave_subjects_out_regression.py – Workflow #2: Cross-subject “leave‐one‐out” evaluation
• README.md – Project description, dependencies, usage instructions
README for additional insights
• Dependencies: numpy, pandas, tensorflow, scipy, matplotlib, seaborn, sklearn
• Usage commands show a linear pipeline: preprocessing + modeling + evaluation + plotting
A. Data Ingestion
B. Preprocessing Module
• window_average.py (rectangle)
• Takes raw data ➔ produces window-averaged features
C. Modeling Workflows (two parallel pipelines)
1. Subject-Specific Regression (rectangle)
• Reads preprocessed features
• Uses TensorFlow / scikit-learn to train per-subject models
• Outputs performance metrics & plots
2. Leave-Subjects-Out Regression (rectangle)
• Iteratively leaves one subject’s data out for testing
• Trains on remaining subjects
• Reports cross-validation metrics & plots
D. Visualization & Reporting
• matplotlib / seaborn modules embedded in each workflow
• Outputs: error distributions, scatter plots, summary tables
Relationships and data flow
1. Data Store ➔ Preprocessing
2. Preprocessing ➔ Subject-Specific Regression
3. Preprocessing ➔ Leave-Subjects-Out Regression
4. Each Regression Module ➔ Visualization & Reporting
Architectural patterns & design principles
• Single pipeline with two parallel experiment tracks
• ELT pattern: Extract (load .mat), Load (in memory), Transform (window_average)
• Modular scripts for separation of concerns (preprocessing vs. modeling vs. evaluation)
• Reproducibility: each script can be run independently with the same inputs
Technologies & frameworks
• Python 3.x
• Data handling: numpy, pandas, scipy (.mat file via scipy.io)
• Modeling: TensorFlow 2.7.0, scikit-learn 1.1.3
• Visualization: matplotlib 3.3.4, seaborn 0.11.1
Essential elements to capture
• Data source (.mat)
• Preprocessing step (window_average.py)
• Two modeling experiments (subject_specific_regression.py and leave_subjects_out_regression.py)
• Visualization/reporting step
• External library dependencies