Skip to main content

Implementation of event-based models for degenerative diseases.

Project description

EBM

This is the python package for implementing Event Based Models for Disease Progression.

Installation

pip install alabEBM

Change Log

  • 2025-02-26. V 0.3.4. Modified the shuffle_order function to ensure full derangement, making convergence faster.

Generate Random Data

from alabEBM import generate, get_params_path, get_biomarker_order_path
import os
import json 

# Get path to default parameters
params_file = get_params_path()

# Get path to biomarker_order
biomarker_order_json = get_biomarker_order_path()

with open(biomarker_order_json, 'r') as file:
    biomarker_order = json.load(file)

generate(
    biomarker_order = biomarker_order,
    real_theta_phi_file=params_file,  # Use default parameters
    js = [50, 100],
    rs = [0.1, 0.5],
    num_of_datasets_per_combination=2,
    output_dir='my_data',
    seed = None,
    prefix = None,
    suffix = None,
)

Run MCMC Algorithms

from alabEBM import run_ebm
from alabEBM.data import get_sample_data_path
import os

print("Current Working Directory:", os.getcwd())

for algorithm in ['soft_kmeans', 'conjugate_priors', 'hard_kmeans']:
    results = run_ebm(
        data_file=get_sample_data_path('25|50_10.csv'),  # Use the path helper
        algorithm=algorithm,
        n_iter=2000,
        n_shuffle=2,
        burn_in=1000,
        thinning=20,
    )

Input data

The input data should have four columns:

  • participant: int
  • biomarker: str
  • measurement: float
  • diseased: bool

An example is https://raw.githubusercontent.com/hongtaoh/alabEBM/refs/heads/main/alabEBM/tests/my_data/10%7C100_0.csv

The data should be in a tidy format, i.e.,

  • Each variable is a column.
  • Each observation is a row.
  • Each type of observational unit is a table.

Features

  • Multiple MCMC algorithms:

    • Conjugate Priors
    • Hard K-means
    • Soft K-means
  • Data generation utilities

  • Extensive logging

Project details


Release history Release notifications | RSS feed

This version

0.3.6

Download files

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

Source Distribution

alabEBM-0.3.6.tar.gz (39.0 kB view details)

Uploaded Source

Built Distribution

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

alabEBM-0.3.6-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file alabEBM-0.3.6.tar.gz.

File metadata

  • Download URL: alabEBM-0.3.6.tar.gz
  • Upload date:
  • Size: 39.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for alabEBM-0.3.6.tar.gz
Algorithm Hash digest
SHA256 08984d0dd13ab24f8ef3394f23b96acf654ce8214f213d6916370d65314e17ef
MD5 7772aa0a99b7fb2fb5e3993e572fb7ae
BLAKE2b-256 9294cb42e2491008b3a0444939c2cb447e4380d745d68d517c577160492a6b17

See more details on using hashes here.

File details

Details for the file alabEBM-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: alabEBM-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.19

File hashes

Hashes for alabEBM-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a096b14ff7087b1484c618d7950f8fcbf2baa59c54c9dc01478b3d716fd9f7a3
MD5 f1dc773716c0759c949ba00852340044
BLAKE2b-256 90db1327252785e58184173d444e51b75c37bc485d3a34bf4b49b8a9354e5b6f

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