-
-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cumulative plot with show_censors option #940
Comments
Hi there, I'm not able to reproduce your error. Can you check what version of lifelines you are on? import lifelines; print(lifelines.__version__) |
Hi Cameron, import lifelines
import lifelines.datasets
%matplotlib inline
data = lifelines.datasets.load_canadian_senators()
KaplanMeierFitter = lifelines.KaplanMeierFitter
kmf = KaplanMeierFitter()
kmf.fit(data['diff_days'], data['observed'])
kmf.plot_cumulative_density(show_censors=True)
By the way, in version 0.21.2, I got a figure like this. |
Thanks! I can now reproduce the error. This helps a lot. I'll fix for a future release. To your second issue: yes, that was fixed in 0.22.1 |
@tsjshg a better solution, and the one I'll implement, is to change the following:
So your entire script becomes:
|
Hi Cameron, your solution fixed the error in version 0.23.9. |
When I use KaplanMeierFitter.plot_cumulative_density with show_censors=True, I got AttributeError: 'PlotEstimateConfig' object has no attribute 'predict_at_times'.
I modified the end of plotting.py from
to
I successfully got my cumulative plot. But I think the code should be changed more correct way.
The text was updated successfully, but these errors were encountered: