Skip to main content

The official implement of Stable Cox

Project description

DOI

System Requirements

Hardware requirements

`Stable Cox' package requires only a standard computer with enough RAM to support the in-memory operations.

Software requirements

OS requirements

This package is supported for Linux. The package has been tested on the following system:

  • Linux: Ubuntu 18.04

Python Dependencies

'Stable Cox' mainly depends on the Python scientific stack.

lifelines=0.27.8
numpy=1.20.3
pandas=2.0.3
scikit-learn=1.3.0

Run demo

omics data

Select topN biomarker and build a predictor on the selected biomarker panel

from StableCox import StableCox import pandas as pd training_pd_data = pd.read_csv('./omics_data/HCC_cancer/train_median.csv', index_col=0)

test1_pd_data = pd.read_csv('./omics_data/HCC_cancer/test1_median.csv', index_col=0)

SC = StableCox(alpha=0.0005, hidden_layer_sizes = (98, 11), W_clip=(0.4, 4))

duration_col = "Survival.months"

event_col="Survival.status"

SC.fit(training_pd_data, duration_col, event_col)

cindex = SC.predict_with_topN(test1_pd_data, topN=10)

print("cindex", cindex)

clinical data

Make prediction directly without biomarker selection

import pandas as pd from StableCox import StableCox training_pd_data = pd.read_csv('./clinical_data/breast_cancer/breast_train_survival.csv', index_col=0)

test1_pd_data = pd.read_csv('./clinical_data/breast_cancer/breast_test1_survival.csv', index_col=0)

training_pd_data = training_pd_data.drop(['Recurr.months', 'Recurr.status', 'Cohort'], axis=1)

test1_pd_data = test1_pd_data.drop(['Recurr.months', 'Recurr.status', 'Cohort'], axis=1)

SC = StableCox(alpha=0.002, hidden_layer_sizes = (69, 15), W_clip=(0.02, 2))

duration_col = "Survival.months"

event_col="Survival.status"

SC.fit(training_pd_data, duration_col, event_col)

cindex = SC.predict(test1_pd_data)

  • The expected running time is from several seconds to mins depends on the number of samples.

License

This project is licensed under the terms of the MIT license.

Project details


Release history Release notifications | RSS feed

This version

0.3

Download files

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

Source Distribution

stablecox-0.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

StableCox-0.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file stablecox-0.3.tar.gz.

File metadata

  • Download URL: stablecox-0.3.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.17

File hashes

Hashes for stablecox-0.3.tar.gz
Algorithm Hash digest
SHA256 95c7d264226bd632b8be4336b91bc89eb20dec7a239b218c527a70d23f43ccaf
MD5 88d3311d9d9d6f4c3731a7a1f4ce205b
BLAKE2b-256 4719bee65858efb7cae8a76291027b3e54f64d53cbd33e8bf4826c6e4f25cac7

See more details on using hashes here.

File details

Details for the file StableCox-0.3-py3-none-any.whl.

File metadata

  • Download URL: StableCox-0.3-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.8.17

File hashes

Hashes for StableCox-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 495abe6875afdc9b5c22be69ae874d3ea52a855e3e12ddcfd94cdb249f54cf8b
MD5 01545bad34fe4f5f9ae0265c84705d60
BLAKE2b-256 dd82b57d841aa89f6a8274341f5e4972623caee0d203c2ba4c6658c5c6a7d506

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