Created
October 8, 2019 10:17
-
-
Save alonsosilvaallende/88122e2e239d2fea7e586c2ac44c9232 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lifelines.utils import concordance_index | |
names = ['Alice', 'Bob', 'Carol', 'Dave', 'Eve'] | |
times = [1, 2, 3, 4, 5] | |
preds = [1, 2, 3, 5, 4] | |
event_obs = [True, True, False, True, True] | |
df = pd.DataFrame(data={'Times': times, 'Predictions': preds, 'Event observed?': event_obs}, index=names) | |
print(df) | |
print(f'Concordance index: {concordance_index(events, preds, event_obs)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment