This package provides an implementation of several survival analysis tools using multiparty computation, based on the MPyC library. This includes the proportional hazards model and the concordance index, along with supporting operations such as secure exponentiation, logarithms, and secure versions of the BFGS and L-BFGS quasi-newton optimization methods.
- Proportional hazards model, based on Efron's method
- Harrell's Concordance index
- Secure fixed-point exponentiation
- Secure fixed-point logarithm
- Secure group-by and group aggregation (e.g. sum, count)
- BFGS and L-BFGS Quasi-Newton optimization methods
- Gradient descent optimization method
- Extensive documentation available on all classes, methods and functions
The package can be installed through pip using the following command:
pip3 install .This should automatically install the mandatory dependencies.
There are several example scripts located within the demos directory. This directory also includes an example dataset of 10.000 records, which was synthetically generated for testing purposes.
Proportional hazards model
To fit the proportional hazards model on the first 100 records with 3 parties:
python3 test_model.py -M3 100Concordance index
To compute the concordance index on the first 100 records with 3 parties:
python3 test_concordance.py -M3 100Secure fixed-point exponentiation
Generate 100 random fixed-point exponents, and evaluate the exponential function on these with 3 parties:
python3 test_np_pow.py -M3 100 32This uses a fixed-point bit-length of 32 bits.
Secure fixed-point logarithm
Generate 100 random fixed-point inputs, and compute the logarithms of these with 3 parties:
python3 test_np_logarithm.py -M3 100 32This uses a fixed-point bit-length of 32 bits.
This implementation was developed as part of the master's thesis:
Van der Meer, Noah. "Privacy-Preserving Survival Analysis" Master Thesis, Eindhoven University of Technology (2025).
which was done under the supervision of Berry Schoenmakers.
Copyright (c) 2025, Noah van der Meer
This software is licenced under the MIT license, which can be found in LICENSE. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.