在python中通过statmodels包运行gamma模型时发出奇怪的警告

问题描述

我已经在Statmodels / Python中的gamma模型上运行了sm.glm函数代码如下:

formula = "median ~ Year"
response,predictors = dmatrices(formula,USA_DATA_1,return_type='dataframe')
mod1 = sm.GLM(response,predictors,family=sm.families.Gamma()).fit()
print(mod1.summary())

我收到消息:

Anaconda3\lib\site-packages\statsmodels\genmod\generalized_linear_model.py:274: DomainWarning: The inverse_power link function does not respect the domain of the Gamma family.
  warnings.warn(("The %s link function does not respect the domain "

即使它为我提供了结果。

这到底是什么意思,此外该消息还提到了inverse_power链接功能

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)