Skip to main content

A Scikit-learn style wrapper for BPXNet

Project description

BPX-Net

Code for Biomarker-Preserved Explainable Networks for Disease Diagnosis and Prognosis with Multi-omics

This is a deep learning framework for medical multimodal data modeling and biomarker discovery

my enviroment

  • Winows 10
  • Anaconda python 3.12.7
  • Pytorch 2.6.0+cu126

dataset

Data samples for each cohort can be found at subdir 'datasets' in csv files.Full version of data is vailable via email:wjcy19870122@163.com

training

(1)Get full datasets and put to datasets
(2) cmd run: python pneu_cross_validation_5folds.py to train pneumonia diagnoiss
(3) cmd run: python gdm_cross_validation_5folds.py to train gdm stratification
(4) cmd run: ccrcc_cross_validation_5folds.py to train ccrcc prognsis
(5) cmd run: aml_cross_validation_5folds.py to train aml treatment response
note: models are saved at checkpoints, and evluation metrics are saved at results

training using custom dataset

(1) put your data in a csv file with each line for sample, each column for features and the label
(2) from datasets.csv_dataset import CsvDataset
    data_file = ['path/your_data.csv']
    ignores=['feature name'] #feature columns to ignore
    dataset = CsvDataset(data_file,
                                label_column='label',#specify the column name of label 
                                ignores=ignores,
                                max_norm=True, #maximum normalization
                                maxv_for_norm=None,#None or numpy array of max values for feature normalization 
                                repeat_fews=True) #set true to alliviate data imbalance   
(3) define model:
    from models.BPXNet import BPXNet
    model = BPXNet(dataset.getNumFeatures(),#input_features
                        bprd_gama = BPRD_gama,#biomarker preservation ratio for BPRD
                        fill_v=-1, #missing values set to -1
                        anfs_hiden_features=128, #the dimension for hiden layers in ANFS
                        anfs_out_activation='tanh', #the activation function for feature importance
                        anfs_ema_alpha=0.98, #EMA weights for updating statistically significant feature importance
                        classifier_name = 'kan', #decision-maker, optional:kan,transformer,resnet18-50, longformer 
                        classifier_layers = [dataset.getNumFeatures(), 128, 128, 128], #the depth of decison-maker
                        num_classes= num_classes,#output number of classes
                        prior_knowledge= prior_weights, #None or preloaded prior feature importance
                        device=device)#device:cpu or cuda

note: details how to use can be referred to pneu_cross_validation_5folds.py

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

bpx_net-0.1.11.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

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

bpx_net-0.1.11-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file bpx_net-0.1.11.tar.gz.

File metadata

  • Download URL: bpx_net-0.1.11.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.4

File hashes

Hashes for bpx_net-0.1.11.tar.gz
Algorithm Hash digest
SHA256 5059e315bb842481dba0f32ec93791a085a08707daec25eea3f7ebe2897a7e4a
MD5 a3d86a1cc14f81ded2a80bc51ba06634
BLAKE2b-256 7046f9cb1a0657fce1772500d49d3fafca2b354dda5223858d183c18dea51ee1

See more details on using hashes here.

File details

Details for the file bpx_net-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: bpx_net-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.4

File hashes

Hashes for bpx_net-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 5fe5f6cc89dff32d9ddb3b91d2ab0ef373738adecbfe81fd52a4f73328ee38ef
MD5 6688e0157441351182fb74f13d97c7c7
BLAKE2b-256 50df7d4c9fcf4b102cb4cd52ea2016a13f660f969a83b4be3b070bac20591c73

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