Revamp survival analysis interface #842
Open
+232
−21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #840
This pull request includes refactoring and enhancements to the survival analysis tools, particularly focusing on the Cox Proportional Hazards (CoxPH), Weibull Accelerated Failure Time (Weibull AFT), and Log-Logistic Accelerated Failure Time (Log-Logistic AFT) models. The changes improve the flexibility and usability of these models by adding new parameters and restructuring the code.
Refactoring and Enhancements:
Code Refactoring:
_regression_model
function into two separate functions:_regression_model_data_frame_preparation
and_regression_model_populate_adata
.Cox Proportional Hazards Model:
cox_ph
function to provide more control over the model fitting process, such asinplace
,key_added_prefix
,alpha
,label
,baseline_estimation_method
,penalizer
,l1_ratio
,strata
,n_baseline_knots
,knots
,breakpoints
,weights_col
,cluster_col
,robust
,formula
,batch_mode
,show_progress
,initial_point
, andfit_options
.Weibull Accelerated Failure Time Model:
weibull_aft
function with additional parameters similar to those added to thecox_ph
function.Log-Logistic Accelerated Failure Time Model:
log_logistic_aft
function to include new parameters.Testing Adjustments:
_sa_func_test
method intests/tools/test_sa.py
to accommodate the updated function signatures, ensuring that tests pass with the new parameters.