QuantReg:'Interactive' 对象没有属性 'fit'
QuantReg:'Interactive' object has no attribute 'fit'
我正在尝试用统计模型拟合分位数回归。在我的笔记本电脑上运行的相同代码在云中失败,并说它没有合适的方法。但是在文档中,我看到它有 fit 方法。是什么原因造成的?我在 zeppelin notebook 中使用它。
from statsmodels.regression.quantile_regression import QuantReg
from statsmodels.tools.tools import add_constant
X = temp[['X']]
y = temp['y']
X = add_constant(X)
mod = QuantReg(y, X)
res = mod.fit(q = 0.5)
这是我收到的错误消息:
AttributeError: 'Interactive' object has no attribute 'fit'
变量 (mod) 似乎在 statsmodel 内部存在命名空间冲突。对 mod 变量使用与 mod1 等不同的名称可能会有所帮助。
我正在尝试用统计模型拟合分位数回归。在我的笔记本电脑上运行的相同代码在云中失败,并说它没有合适的方法。但是在文档中,我看到它有 fit 方法。是什么原因造成的?我在 zeppelin notebook 中使用它。
from statsmodels.regression.quantile_regression import QuantReg from statsmodels.tools.tools import add_constant X = temp[['X']] y = temp['y'] X = add_constant(X) mod = QuantReg(y, X) res = mod.fit(q = 0.5)
这是我收到的错误消息:
AttributeError: 'Interactive' object has no attribute 'fit'
变量 (mod) 似乎在 statsmodel 内部存在命名空间冲突。对 mod 变量使用与 mod1 等不同的名称可能会有所帮助。