Skip to main content

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},
}

Metadata

Release files for masurvival 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for masurvival 0.1.2
File Size Uploaded
masurvival-0.1.2.tar.gz 3.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for masurvival 0.1.2
File
masurvival-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
masurvival-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details
masurvival-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
masurvival-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 Details

Total release size: 26.2 MB

Release files / masurvival-0.1.2.tar.gz

Download URL masurvival-0.1.2.tar.gz
Size 3.3 MB
Tags Source
SHA-256 checksum
How to use checksums
deac8898e2a40937944412d3375d3e9d5bd1a018ed55de5fb85c8ef417c9270f
BLAKE2b-256 checksum
How to use checksums
c65a0d5fce6d5d3d7d2354695c0c58cdf306efdb50b8d15609bf4ed7b6bf7f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / masurvival-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL masurvival-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.7 MB
Tags CPython 3.13 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
cdd9c81b30582d8a04b4276b3a09e2b4027d0db60c4bba23060a91923f51d030
BLAKE2b-256 checksum
How to use checksums
9b16805cbfef5ace0b0328e16492862a90618e2e6cd24ee1b61abf1bd2e1bf4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / masurvival-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL masurvival-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.8 MB
Tags CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
bba5fd80cfcc9a5101d88459b2191f9d2d77b4680c59604f6d60ef5d42a81095
BLAKE2b-256 checksum
How to use checksums
b1670d8c4adf7d2f9621432b213816626f47a7648cb429b8bdcbaf1281e8dd4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / masurvival-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL masurvival-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.8 MB
Tags CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
34412c056609ea22c1d10737ec1b6ceadab7ebf00eb56b7e69f1d4a0c67c6cb8
BLAKE2b-256 checksum
How to use checksums
2134cecd966ae0e6f34ccb2201fadfb9f81b471f2fac0b1887eef07ca2063520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / masurvival-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL masurvival-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 5.6 MB
Tags CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2a6d306a2081147d2836a9a11008af0319854fc1ca1b4cda3eb062cd117b1fe3
BLAKE2b-256 checksum
How to use checksums
d2d48bab93ac0b33eb7f121a2d4b64082dd3c8605d19587b3692e663421c6085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page