This class contains the base which is used to train data upon.
print(df.shape)
df.head()
model = ModelHazard('cox')
model.fit(df)
# %tensorboard --logdir ./lightning_logs/
λ, Λ = model.predict(df)
df.shape, λ.shape, Λ.shape
Modelling Distribution with AFT models
model = ModelAFT('Gumbel')
model.fit(df)
surv_prob = model.predict(df)
mode_time = model.predict_time(df)
df["surv_prob"] = surv_prob
df["mode_time"] = mode_time
df
plt.hist(df[df["e"] == 1]["surv_prob"].values, bins=30, alpha=0.5, density=True, label="death")
plt.hist(df[df["e"] == 0]["surv_prob"].values, bins=30, alpha=0.5, density=True, label="censored")
plt.legend()
plt.show()
# %tensorboard --logdir ./lightning_logs/