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

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

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.3.tar.gz (39.9 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.3-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file alabebm-0.3.3.tar.gz.

File metadata

  • Download URL: alabebm-0.3.3.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for alabebm-0.3.3.tar.gz
Algorithm Hash digest
SHA256 2c5912073e93b1b8595185d3567148f07da43d241f95feba767d2d2806b162aa
MD5 d55efba210f480779858009fcd87efb9
BLAKE2b-256 7de1c8c57bbdba26c2f19525b33330f1164642445cfed7da5a1aa6ca90fbad91

See more details on using hashes here.

File details

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

File metadata

  • Download URL: alabEBM-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for alabEBM-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b142f273433239c838f75b5cdef1060162d2aec37fa453c07cad189d27f1338d
MD5 088e09fcd66249c3999e6a5554e7437b
BLAKE2b-256 f82a8c4245e35952be8c9691a65baa7c6b917dd1fd43cb3801d539976d423cea

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