Skip to main content

MASurvival: Missingness-Avoiding Survival Forest - An extension of scikit-survival with missingness-avoidance regularization for handling missing data in survival analysis

Project description

MASurvival (Missingness-Avoiding Survival Forest) is a Python module for survival analysis built on top of scikit-learn and based on scikit-survival. It extends scikit-survival with missingness-avoidance regularization, allowing survival analysis models to better handle missing data by penalizing splits on features with missing values.

Key Feature: The alpha parameter in RandomSurvivalForest penalizes splits on features with missing values, making the model more robust to missing data without requiring imputation.

About Survival Analysis

The objective in survival analysis (also referred to as time-to-event or reliability analysis) is to establish a connection between covariates and the time of an event. What makes survival analysis differ from traditional machine learning is the fact that parts of the training data can only be partially observed – they are censored.

For instance, in a clinical study, patients are often monitored for a particular time period, and events occurring in this particular period are recorded. If a patient experiences an event, the exact time of the event can be recorded – the patient’s record is uncensored. In contrast, right censored records refer to patients that remained event-free during the study period and it is unknown whether an event has or has not occurred after the study ended. Consequently, survival analysis demands for models that take this unique characteristic of such a dataset into account.

Requirements

  • Python 3.10 or later

  • ecos

  • joblib

  • numexpr

  • numpy

  • osqp

  • pandas 2.0.0 or later

  • scikit-learn 1.6 or 1.7

  • scipy

  • C/C++ compiler

Installation

Install MASurvival from PyPI:

pip install masurvival

Or install from source:

git clone https://github.com/anli66/masurvival
cd masurvival
pip install -e .

Examples

MASurvival provides a drop-in replacement for RandomSurvivalForest from scikit-survival with an additional alpha parameter for missingness-avoidance regularization:

from masurvival.ensemble import RandomSurvivalForest
from masurvival.metrics import concordance_index_censored

# Create model with missingness-avoidance regularization
rsf = RandomSurvivalForest(
    n_estimators=100,
    alpha=1.0,  # Penalty for splits on features with missing values
    random_state=42
)

rsf.fit(X_train, y_train)
predictions = rsf.predict(X_test)

Help and Support

Documentation

References

MASurvival is based on scikit-survival. Please cite the original scikit-survival paper:

S. Pölsterl, “scikit-survival: A Library for Time-to-Event Analysis Built on Top of scikit-learn,” Journal of Machine Learning Research, vol. 21, no. 212, pp. 1–6, 2020.

@article{sksurv,
  author  = {Sebastian P{\"o}lsterl},
  title   = {scikit-survival: A Library for Time-to-Event Analysis Built on Top of scikit-learn},
  journal = {Journal of Machine Learning Research},
  year    = {2020},
  volume  = {21},
  number  = {212},
  pages   = {1-6},
  url     = {http://jmlr.org/papers/v21/20-729.html}
}

Note: MASurvival extends scikit-survival with missingness-avoidance regularization. If you use MASurvival in your research, please also cite this work appropriately.

@article{masurvival,
  author  = {Aneta Lisowska},
  title   = {MASurvival: Missingness-Avoiding Survival Forest},
  year    = {2025},
}

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

masurvival-0.1.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distributions

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

masurvival-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

masurvival-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

masurvival-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

masurvival-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (5.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file masurvival-0.1.2.tar.gz.

File metadata

  • Download URL: masurvival-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for masurvival-0.1.2.tar.gz
Algorithm Hash digest
SHA256 deac8898e2a40937944412d3375d3e9d5bd1a018ed55de5fb85c8ef417c9270f
MD5 8fb748f4a40b55f1e7c469eb0063c39b
BLAKE2b-256 c65a0d5fce6d5d3d7d2354695c0c58cdf306efdb50b8d15609bf4ed7b6bf7f6c

See more details on using hashes here.

File details

Details for the file masurvival-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for masurvival-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cdd9c81b30582d8a04b4276b3a09e2b4027d0db60c4bba23060a91923f51d030
MD5 1c8166ae79fb0aee5d75d6aed5a920cc
BLAKE2b-256 9b16805cbfef5ace0b0328e16492862a90618e2e6cd24ee1b61abf1bd2e1bf4c

See more details on using hashes here.

File details

Details for the file masurvival-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for masurvival-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bba5fd80cfcc9a5101d88459b2191f9d2d77b4680c59604f6d60ef5d42a81095
MD5 5a18a8e98d786057b73d644869c50a88
BLAKE2b-256 b1670d8c4adf7d2f9621432b213816626f47a7648cb429b8bdcbaf1281e8dd4b

See more details on using hashes here.

File details

Details for the file masurvival-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for masurvival-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 34412c056609ea22c1d10737ec1b6ceadab7ebf00eb56b7e69f1d4a0c67c6cb8
MD5 6f9219b25d246a84df9c21888065703e
BLAKE2b-256 2134cecd966ae0e6f34ccb2201fadfb9f81b471f2fac0b1887eef07ca2063520

See more details on using hashes here.

File details

Details for the file masurvival-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for masurvival-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2a6d306a2081147d2836a9a11008af0319854fc1ca1b4cda3eb062cd117b1fe3
MD5 b8b6c7397fb894eef85d02a7797864a6
BLAKE2b-256 d2d48bab93ac0b33eb7f121a2d4b64082dd3c8605d19587b3692e663421c6085

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