Skip to content

RISCSoftware/shuntclf

Repository files navigation

title emoji colorFrom colorTo sdk sdk_version python_version suggested_hardware app_file pinned license
Shuntclf
🚀
blue
blue
gradio
5.35.0
3.11
cpu-basic
shuntclf/web/gradio_app.py
false
mit

Chronic Posthemorrhagic Hydrocephalus Prediction

Introduction

This repository contains the code used to create the machine learning models described in the study "Machine learning algorithms used for the prediction of chronic shunt-dependent hydrocephalus after spontaneous subarachnoid hemorrhage" by M. Gollwitzer and colleagues. Our research aims to identify early predictors of chronic shunt-dependent hydrocephalus to improve clinical outcomes. We employ several machine learning techniques to enhance the prediction of this condition.

Dataset

The dataset is located at data/dataset.csv and includes features such as patient age at diagnosis, sex, Hunt & Hess grade, Fisher grade, presence of a central nervous system (CNS) infection, external ventricular drainage (EVD) placement, aneurysm characteristics, and treatment methods. It was compiled from the medical records of 510 patients who were treated for spontaneous subarachnoid hemorrhage (SAH) at our institution from January 2013 to December 2018 and met specific inclusion criteria related to SAH diagnosis and outcome data availability. Data collection was retrospective, with radiologic findings assessed by a single neuro-radiologist in a blinded fashion.

Feature Description Table

Variable Name Description
age_diagnose Age of the patient at the time of diagnosis.
sex Sex of the patient (male or female).
hunt_hess Hunt and Hess grading of the hemorrhage to assess severity.
fisher Fisher scale score, which predicts the risk of delayed cerebral ischemia based on the amount of blood detected on a CT scan.
cns_infection Presence (1) or absence (0) of a central nervous system infection.
EVD External ventricular drainage placement (1 if placed, 0 if not).
aneurysm Presence (1) or absence (0) of an aneurysm.
aneurysm_location Location of the aneurysm, e.g., MCA (Middle Cerebral Artery), ACom (Anterior Communicating Artery).
aneurysm_diameter The maximum diameter of the aneurysm (millimeters).
aneurysm_height The maximum height of the aneurysm (millimeters).
aneurysm_treatment Treatment method for the aneurysm, e.g., coil or clip.
shunt Whether a shunt was required (1) or not (0). This is the target variable throughout our study.

Installation

The Python environment for running the analysis can be set up using either Poetry or pip:

Usage

Training the Models

Run the training script located at shuntclf/main.py.

This script will train the classifiers using nested cross-validation. The results are saved to output/current/ including:

  • report.csv: Contains the performance metrics for predictive models for shunt implantation.
  • feature_importance.json: Contains the feature importance metrics, including coefficients and odds ratios for the logistic regression model.

Model Inference Web UI

For interactive model predictions, start the Gradio web application at shuntclf/web/gradio_app.py.

This application is also hosted online at: https://huggingface.co/spaces/risc42/shuntclf

License

  • The source code of this project is licensed under the MIT License.
  • The dataset provided in data/dataset.csv is licensed under the Creative Commons Attribution 4.0 International License. See the data/LICENSE-DATA.txt file for more details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages