PE prediction model (batch scoring and evaluation).
Project description
Batch PE Risk Prediction
This tool runs the Pre-Eclampsia (PE) risk prediction model on a CSV file. Each row represents a patient, and the script outputs a new CSV with an added score column (predicted probability).
1. Input CSV Format
Your input CSV must contain column names that appear in Features.csv.
Core numeric features
age– yearsht– height in centimeterswt– weight in kilogramsinterval– inter-pregnancy intervallast.ga– gestational age at last delivery (weeks)- (full model only)
ga,pappa,plgf,utpi,map,plgf.machine
Optional raw-unit features
Instead of writing the base units, you may provide:
ht_ft,ht_in→ height in feet and inches (converted tohtin cm)wt_lb→ weight in pounds (converted towtin kg)ga_weeks→ gestational age in weeks (converted togain days; full model only)
If both raw-unit and base-unit columns exist, the script prefers:
ht_ft/ht_inoverhtwt_lboverwtga_weeksoverga
Categorical features
Use the category names defined in Features.csv → valid_options (e.g., White, Spontaneous, No, etc.), or provide numeric codes 0/1/2 matching those options.
Missing values are allowed and will be imputed automatically using the median (or median category) from Features.csv.
2. Running From the Terminal
Assuming your script is named main.py:
Partial model, case 3
python main.py \
--input data/input.csv \
--output results/output.csv \
--case 3
Full model, case 3
python main.py \
--input data/input_full.csv \
--output results/output_full.csv \
--case 3 \
--full
3. Running a Different CSV File
Step 1: Add your CSV
Place your file in the data/ folder, for example:
data/new_patients.csv
Step 2: Edit launch.json (VS Code)
Modify the arguments:
- Change
data/input.csv→data/new_patients.csv - Change
results/output.csv→results/new_output.csv(optional) - Change
3→1if you want to run--case 1 - Add
--fullto use the full model
Step 3: Run
In VS Code:
- Open the Run/Debug panel
- Select Python: Run main.py
- Click Run
The output CSV will be saved at the path specified in --output, containing all original columns plus the new score column.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pepred-0.1.0.tar.gz.
File metadata
- Download URL: pepred-0.1.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b52035f81626039dfabd845f94ca92b0c81d4397c9a2ab5d79c3f84d881f9ed
|
|
| MD5 |
edd866e2a7b60a1b0e77fb551333a32b
|
|
| BLAKE2b-256 |
b130d2fd302934b2bbf6ef8693e361cccc4327c1e7ca921100229624f874727d
|
File details
Details for the file pepred-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pepred-0.1.0-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
257a67e28a2be0443436e649f0e5a7f68beffd3b00e5b01097579d5efd2514e1
|
|
| MD5 |
ef297d7f14051a9235b62c6b5bd49701
|
|
| BLAKE2b-256 |
1e19152f4352ad993e095646794da48d15c841ee910dfb24a57ef2fb5642eb5b
|