SurvPath icon indicating copy to clipboard operation
SurvPath copied to clipboard

code for predicting risk scores

Open sjjadsa opened this issue 11 months ago • 2 comments

could u please release the code for predicting risk scores,especially using the model from each and predict the correspoding validation set.thanks

We do not provide the code for drawing KM curves as it is pretty standard code from lifelines. However, here's an overview of the process. We first use the model from each fold post training to predict the risk scores on the validation set for that fold. Then we concat the risk scores for all of the validation folds, giving us the risk scores for the entire dataset. We then use lifelines to fit a KM fitter and plot in 2 risk groups (high and low). The same package is used to perform the logrank statistical test between risk groups as well.

Please let us know if something is unclear and we would be happy to help!

Originally posted by @ajv012 in #15

sjjadsa avatar Feb 19 '25 02:02 sjjadsa

From the logits, the risks are calculated as:

https://github.com/mahmoodlab/SurvPath/blob/main/utils/core_utils.py#L409

guillaumejaume avatar Feb 20 '25 21:02 guillaumejaume

thank u

sjjadsa avatar Feb 24 '25 05:02 sjjadsa