Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/rust/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 使用交叉验证XGboost时出现Windows错误0xe06d7363_Python_Windows_Jupyter_Xgboost - Fatal编程技术网

Python 使用交叉验证XGboost时出现Windows错误0xe06d7363

Python 使用交叉验证XGboost时出现Windows错误0xe06d7363,python,windows,jupyter,xgboost,Python,Windows,Jupyter,Xgboost,我正在为python使用xgb api,在尝试执行xgb.cv时,出现以下错误: param = {'max_depth': 6, 'eta': 0.1,'objective' :'reg:squarederror','subsample':0.8 ,'gamma':0, 'colsample_bytree':1,'nthread':cores,'base_score':y_train.mean(),'eval_metric':'rmse'} num_round = 1 eva

我正在为python使用xgb api,在尝试执行xgb.cv时,出现以下错误:

param = {'max_depth': 6, 'eta': 0.1,'objective' :'reg:squarederror','subsample':0.8 ,'gamma':0,
         'colsample_bytree':1,'nthread':cores,'base_score':y_train.mean(),'eval_metric':'rmse'}
num_round = 1
evallist = [(test, 'eval'), (train, 'train')]


xgb.cv(param, train, num_round, nfold=5,
           metrics={'error'}, seed=0,
           callbacks=[xgb.callback.print_evaluation(show_stdv=True)])
    
    
        OSError                                   Traceback (most recent call last)
        <ipython-input-29-9d56c9a868ed> in <module>
              5 xgb.cv(param, train, num_round, nfold=5,
              6        metrics={'error'}, seed=0,
        ----> 7        callbacks=[xgb.callback.print_evaluation(show_stdv=True)])
        
        ~\Anaconda3\lib\site-packages\xgboost\training.py in cv(params, dtrain, num_boost_round, nfold, stratified, folds, metrics, obj, feval, maximize, early_stopping_rounds, fpreproc, as_pandas, verbose_eval, show_stdv, seed, callbacks, shuffle)
            464     results = {}
            465     cvfolds = mknfold(dtrain, nfold, params, seed, metrics, fpreproc,
        --> 466                       stratified, folds, shuffle)
            467 
            468     # setup callbacks
        
        ~\Anaconda3\lib\site-packages\xgboost\training.py in mknfold(dall, nfold, param, seed, evals, fpreproc, stratified, folds, shuffle)
            323     for k in range(nfold):
            324         # perform the slicing using the indexes determined by the above methods
        --> 325         dtrain = dall.slice(in_idset[k])
            326         dtest = dall.slice(out_idset[k])
            327         # run preprocessing on the data set if needed
        
        ~\Anaconda3\lib\site-packages\xgboost\core.py in slice(self, rindex, allow_groups)
            955                                                  c_bst_ulong(len(rindex)),
            956                                                  ctypes.byref(res.handle),
        --> 957                                                  ctypes.c_int(1 if allow_groups else 0)))
            958         return res
            959 
        
        OSError: [WinError -529697949] Windows Error 0xe06d7363
param={'max_depth':6,'eta':0.1,'objective':'reg:squarederror','subsample':0.8,'gamma':0,
“colsample\u bytree”:1,'nthread':cores,'base\u score':y\u train.mean(),'eval\u metric':'rmse'}
num_round=1
evallist=[(测试,'eval'),(列车,'train')]
xgb.cv(参数,序列,循环数,nfold=5,
度量={'error'},seed=0,
回调=[xgb.callback.print\u求值(show\u stdv=True)])
OSError回溯(最近一次调用上次)
在里面
5 xgb.cv(参数、序列、轮数、nfold=5,
6指标={'error'},种子=0,
---->7回调=[xgb.callback.print\u求值(show\u stdv=True)])
cv中的~\Anaconda3\lib\site packages\xgboost\training.py(参数、dtrain、num\u boost\u round、nfold、分层、折叠、度量、obj、feval、最大化、提前停止\u rounds、fpreproc、as\u pandas、verbose\u eval、show\u stdv、seed、callbacks、shuffle)
464结果={}
465 cvfolds=mknfold(数据训练、nfold、参数、种子、度量、fpreproc、,
-->466分层、折叠、洗牌)
467
468#设置回调
mknfold中的~\Anaconda3\lib\site packages\xgboost\training.py(dall、nfold、param、seed、evals、fpreproc、分层、折叠、洗牌)
323适用于范围内的k(nfold):
324#使用上述方法确定的索引执行切片
-->325 dtrain=dall.slice(在idset[k]中)
326 dtest=dall.slice(out_idset[k])
327#如果需要,对数据集运行预处理
切片中的~\Anaconda3\lib\site packages\xgboost\core.py(self、rindex、allow\u组)
955 c_bst_ulong(len(rindex)),
956 ctypes.byref(res.handle),
-->957 ctypes.c_int(如果允许,则为1,否则为0)))
958返回res
959
操作错误:[WinError-529697949]Windows错误0xe06d7363
我已经尝试安装和卸载XGB,但我认为这不是问题所在,因为我可以进行培训,问题在于我尝试进行交叉验证时

我正在使用:

Python:3.7.3(默认值,2019年4月24日,15:29:51)[MSC v.1915 64位(AMD64)]

xgb.版本“1.1.0”

更新20200831

它对我的作用是:

一,。卸载xgboost

二,。升级pip

三,。使用pip3重新安装xgboost安装xgboost