Skip to main content

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 – years
  • ht – height in centimeters
  • wt – weight in kilograms
  • interval – inter-pregnancy interval
  • last.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 to ht in cm)
  • wt_lb → weight in pounds (converted to wt in kg)
  • ga_weeks → gestational age in weeks (converted to ga in days; full model only)

If both raw-unit and base-unit columns exist, the script prefers:

  • ht_ft / ht_in over ht
  • wt_lb over wt
  • ga_weeks over ga

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.csvdata/new_patients.csv
  • Change results/output.csvresults/new_output.csv (optional)
  • Change 31 if you want to run --case 1
  • Add --full to 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pepred-0.1.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pepred-0.1.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

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

Hashes for pepred-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b52035f81626039dfabd845f94ca92b0c81d4397c9a2ab5d79c3f84d881f9ed
MD5 edd866e2a7b60a1b0e77fb551333a32b
BLAKE2b-256 b130d2fd302934b2bbf6ef8693e361cccc4327c1e7ca921100229624f874727d

See more details on using hashes here.

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

Hashes for pepred-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 257a67e28a2be0443436e649f0e5a7f68beffd3b00e5b01097579d5efd2514e1
MD5 ef297d7f14051a9235b62c6b5bd49701
BLAKE2b-256 1e19152f4352ad993e095646794da48d15c841ee910dfb24a57ef2fb5642eb5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page