Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.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,XGBClassifier:未知目标函数错误_Python_Machine Learning_Xgboost_Xgbclassifier - Fatal编程技术网

Python XGBoost,XGBClassifier:未知目标函数错误

Python XGBoost,XGBClassifier:未知目标函数错误,python,machine-learning,xgboost,xgbclassifier,Python,Machine Learning,Xgboost,Xgbclassifier,我试图训练一个XGBClassifier,但是我得到了这个错误。我使用的是xgboost版本1.1.0。我使用pip安装xgboost来安装xgboost,并对其进行了升级 param_dict = {'n_estimators':i, 'max_depth':j, 'objective':'binary:logistic'} clf = xgb.XGBClassifier(param_dict) clf.fit(X_tr_1, y_train) XGBoostError: [08:00:

我试图训练一个XGBClassifier,但是我得到了这个错误。我使用的是xgboost版本1.1.0。我使用pip安装xgboost来安装xgboost,并对其进行了升级

param_dict = {'n_estimators':i, 'max_depth':j, 'objective':'binary:logistic'}

clf = xgb.XGBClassifier(param_dict)
clf.fit(X_tr_1, y_train)


XGBoostError: [08:00:25] C:\Users\Administrator\workspace\xgboost-win64_release_1.1.0\src\objective\objective.cc:26: Unknown objective function: `{'objective': 'binary:logistic', 'eta': 0.02, 'max_depth': 4}`
Objective candidate: survival:aft
Objective candidate: binary:hinge
Objective candidate: multi:softprob
Objective candidate: multi:softmax
Objective candidate: rank:ndcg
Objective candidate: rank:map
Objective candidate: rank:pairwise
Objective candidate: reg:squaredlogerror
Objective candidate: reg:logistic
Objective candidate: binary:logistic
Objective candidate: reg:gamma
Objective candidate: reg:tweedie
Objective candidate: count:poisson
Objective candidate: survival:cox
Objective candidate: binary:logitraw
Objective candidate: reg:linear
Objective candidate: reg:squarederror

猜测您一定使用了GridSearch技术来找出最佳超参数,甚至明确指定它,将dictionary对象
param_dict
作为参数传递给XGBoost分类器方法的正确方法是-

clf = xgb.XGBClassifier(**param_dict)

你的意思是
clf=xgb.XGBClassifier(**param_dict)