Skip to content
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

predict_hazard method of GeneralizedGammaRegressionFitter is error #1489

Open
phruekc opened this issue Feb 2, 2023 · 0 comments
Open

predict_hazard method of GeneralizedGammaRegressionFitter is error #1489

phruekc opened this issue Feb 2, 2023 · 0 comments

Comments

@phruekc
Copy link

phruekc commented Feb 2, 2023

There is error regarding to input dimensions of GeneralizedGammaRegressionFitter.
See this example;

from lifelines import GeneralizedGammaRegressionFitter
from lifelines.datasets import load_regression_dataset
regression_dataset = load_regression_dataset()

ggr = GeneralizedGammaRegressionFitter()
ggr.fit_intercept = True
ggr.fit(regression_dataset, 'T', event_col='E')

plotting Survival Function works normally

ggr.plot_partial_effects_on_outcome('var1', values=np.arange(-7,8), cmap='coolwarm')
but plotting Hazard function gives this value error regarding to dimensions of input.

ggr.plot_partial_effects_on_outcome('var1', values=np.arange(-7,8), cmap='coolwarm', y='hazard') 

>>> ValueError: Length of values (200) does not match length of index (15)

By the way, I've drilled down to the source code and found that this error comes from self.predict_hazard

Please kindly let me know how to make it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant