挥霍是什么意思⽤xgboost进⾏⽹格搜索与交叉验证时出现的问题
cv_params = {'n_estimators': [6,10,20,50],'learning_rate':[0.1,0.01,0.05]}
other_params = { 'max_depth': 5, 'min_child_weight': 1, 'ed': 0,'silent':0,
'subsample': 0.8, 'colsample_bytree': 0.8, 'gamma': 0, 'reg_alpha': 0, 'reg_lambda': 1}
model = xgb.XGBClassifier(**other_params)
optimized_GBM = GridSearchCV(estimator=model, param_grid=cv_params, scoring='accuracy', cv=5, verbo=1,
意趣n_jobs=80)
在这⾥会提⽰sklearn没有安装,这不扯了吗,之前都import了,然后查阅资料才知道是啥问题,sklearn的;版本问题,如果⽤0.20版本的话出问题,所以我换成0.19,然后再重新打开jupyter。硬干
后来⼜出现下⾯这个问题,怎么解决的呢?
RemoteTraceback Traceback (most recent call last)
托福考试时间安排
85
86 # No metrics support "multiclass-multioutput" format
87 if (y_type not in ["binary", "multiclass", "multilabel-indicator"]):
---> 88 rai ValueError("{0} is not supported".format(y_type))
y_type = 'unknown'江门学校
89
化学专业就业前景90 if y_type in ["binary", "multiclass"]:
91 y_true = column_or_1d(y_true)
92 y_pred = column_or_1d(y_pred)
手续费英文ValueError: unknown is not supported
______________________________________
anna chapman
解决办法:
仔细⼜看了这个问题,出现在数据类型上,然后想起之前做xgboost时,y_train需要时list数据,⽽我⾃⼰的数据类型是np.array,所以⼜改变了数据类型。
总结:
tfbawfully⽆论出现什么问题,⼀定要仔细思考出现问题可能的原因是什么?,思考⼀下如何可以解决,⽽不是⼀味地baidu