fla*_*mes 7 python gpu xgboost
我一直在尝试在 Jupyter Notebook 中训练 XGBoost 模型。我通过以下命令安装了 XGboost(GPU):
\n\ngit clone \xe2\x80\x94 recursive https://github.com/dmlc/xgboost\ncd xgboost\nmkdir build\ncd build\ncmake .. -DUSE_CUDA=ON\nmake -j\nRun Code Online (Sandbox Code Playgroud)\n\n但每当我尝试训练模型时model.fit,内核都会在几分钟后重新启动。\n代码:
params = { 'max_depth': 50, 'n_estimators':80, 'learning_rate':0.1, 'colsample_bytree':7, 'gamma':0, 'reg_alpha':4, 'objective':'binary:logistic', 'eta':0.3, 'silent':1, 'subsample':0.8, 'tree_method':'gpu_hist', 'predictor':'gpu_predictor',}\nxgb_model = xgb.XGBClassifier(**params).fit(X_train, y_train) \nxgb_prediction = xgb_model.predict(X_valid)\nRun Code Online (Sandbox Code Playgroud)\n\n其中 X_train 和 y_train 源自 sklearnTfidfVectorizer
我已经安装了 cuda,\ncat /usr/local/cuda/version.txt给出:CUDA Version 10.2.89