Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.
biolearn.mortality.calculate_age_adjusted_c_index#
- biolearn.mortality.calculate_age_adjusted_c_index(data, predictor_results)#
Calculates the C-index for each predictor in the predictor_results DataFrame, adjusted for age.
- Parameters:
data (Dataset) – A Dataset object containing metadata with columns: ‘dead’ - boolean indicating if the subject is dead ‘years_until_death’ - if dead this should be years between sample collection and death. Otherwise years between sample collection and last known contact with live subject ‘age’ - age of the subject at sample collection
predictor_results (pd.DataFrame) – The DataFrame containing predictor results. Columns are the name of the predictor model and rows must be ids from data
- Returns:
A DataFrame containing C-index values for each predictor.
- Return type:
pd.DataFrame