XGBoost crashing kernel in jupyter notebook

∥☆過路亽.° 提交于 2020-01-23 03:07:13

问题


I don't know how to make the XGBoost classifier work. I am running the code below on jupyter notebook, and it always generates this message "The kernel appears to have died. It will restart automatically."

from xgboost import XGBClassifier
model = XGBClassifier()
model.fit(X, y)

There is no problem with importing the XGBClassifier, but it crashes upon fitting it to my data. X is a 502 by 33 all-numeric dataframe, y is the set of 0 or 1 labels for each row. Does anyone know what could be the problem here? I downloaded the newest version of xgboost through pip3 install, and also through conda install.

Thanks!


回答1:


I was having similar problem. I solved it by installing an older version 0.80.

pip install xgboost==0.80



回答2:


import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
from xgboost import XGBClassifier
model = XGBClassifier()
model.fit(X, y)


来源:https://stackoverflow.com/questions/51768403/xgboost-crashing-kernel-in-jupyter-notebook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!