[Python] TypeError: KaplanMeierFitter.fit() got an unexpected keyword argument 'duration'

Discussão em 'Python' iniciado por Stack, Setembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to use Kaplan Meier Estimator in my python 3.10.12. My data set looks like

    | duration |Paid_off|
    | | |
    ---------------------
    | 19.0 | 1 |
    | 24.0 | 0 |


    I have written following python code

    from lifelines import KaplanMeierFitter
    data_kmf=KaplanMeierFitter()
    data_kmf.fit(duration=data_df["duration"],event_observed=data_df["paid_off"])


    But I'm getting error saying

    TypeError: KaplanMeierFitter.fit() got an unexpected keyword argument 'duration'

    Can you please help me to resolve the error?

    Continue reading...

Compartilhe esta Página