我使用了conda来安装软件包pygam
,
根据示例代码,对于LinearGAM
,LogisticGAM
之类的类,其功能可以拟合和预测,但我无法访问terms
对象。 (昨晚有效)
gam
LinearGAM(callbacks=[Deviance(), Diffs()], constraints=None,
dtype='auto', fit_intercept=True, fit_linear=False,
fit_splines=True, lam=0.6, max_iter=100, n_splines=25,
penalties='auto', scale=None, spline_order=3, tol=0.0001,
verbose=False)
gam.terms
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-97-e7c78df77f0c> in <module>
----> 1 gam.terms
AttributeError: 'LinearGAM' object has no attribute 'terms'
from pygam import LinearGAM
有效
但是,
from pygam import s
不是
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-105-de46d9d5d0c0> in <module>
----> 1 from pygam import s
ImportError: cannot import name 's'
from pygam.datasets import toy_classification
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-104-d9231b1e2864> in <module>
----> 1 from pygam.datasets import toy_classification
ModuleNotFoundError: No module named 'pygam.datasets'
我重新安装了conda,但无法解决问题