Last active
October 8, 2019 10:11
-
-
Save alonsosilvaallende/62bf039e2acedca0b55d1b97361d2d23 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'] | |
events = [1, 2, 3, 4, 5] | |
preds = [1, 2, 3, 4, 4] | |
df = pd.DataFrame(data={'Churn times': events, 'Predictions': preds}, index=names) | |
print(df) | |
print(f'Concordance index: {concordance_index(events, preds)}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment