问题描述
文件 h2otest.py 包含https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/glm.html上的简化版代码:
import h2o
h2o.init()
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
prostate = h2o.import_file("https://h2o-public-test-data.s3.amazonaws.com/smalldata/prostate/prostate.csv")
prostate['CAPSULE'] = prostate['CAPSULE'].asfactor()
prostate['RACE'] = prostate['RACE'].asfactor()
prostate['DCAPS'] = prostate['DCAPS'].asfactor()
prostate['DPROS'] = prostate['DPROS'].asfactor()
predictors = ["AGE","RACE","VOL","GLEASON"]
response_col = "CAPSULE"
glm_model = H2OGeneralizedLinearEstimator(family="binomial",lambda_= 0,compute_p_values=True)
glm_model.train(predictors,response_col,training_frame= prostate)
print('Finished')
我在Conda环境 pycharm 中的命令行上运行代码,在该环境中从PyPi安装了h2o 3.30.1.3。我正在使用Python 3.8。我在Mac和Linux服务器上都遇到相同的错误。启动时没有现有的H2O服务器:
(pycharm) $> python h2otest.py
...
Parse progress: |█████████████████████████████████████████████████████████████████████████████| 100%
glm Model Build progress: |███████████████████████████████████████████████████████████████████| 100%
Finished
Closing connection _sid_a7a8 at exit
H2O session _sid_a7a8 closed.
Exception ignored in: <function ExprNode.__del__ at 0x7f9ee65f83a0>
Traceback (most recent call last):
File "/Users/geiringesandnes/miniconda3/envs/pycharm/lib/python3.8/site-packages/h2o/expr.py",line 204,in __del__
File "/Users/geiringesandnes/miniconda3/envs/pycharm/lib/python3.8/site-packages/h2o/expr.py",line 258,in rapids
TypeError: 'nonetype' object is not callable
Exception ignored in: <function ExprNode.__del__ at 0x7f9ee65f83a0>
Traceback (most recent call last):
File "/Users/geiringesandnes/miniconda3/envs/pycharm/lib/python3.8/site-packages/h2o/expr.py",in rapids
TypeError: 'nonetype' object is not callable
如何消除这些错误消息?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)