Skip to content

Commit

Permalink
Fixing istake in survival rates computation
Browse files Browse the repository at this point in the history
  • Loading branch information
aiaragomes committed Aug 23, 2023
1 parent 4c4e24e commit fdfe23f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v6_healthai_dashboard_py/survival.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def survival_rate(df: pd.DataFrame, cutoff: int, delta: int) -> list:
all_dead = len(df[df['vital_status'] == 'dead'])
survival_rates = []
for time in times:
dead = len(df[df['survival_days'] <= time])
dead = len(
df[(df['survival_days'] <= time) & (df['vital_status'] == 'dead')]
)
alive = (all_dead - dead) + all_alive
survival_rates.append(alive / len(df))

Expand Down

0 comments on commit fdfe23f

Please sign in to comment.