__init__() 得到了一个意外的关键字参数“iid”

问题描述

我正在尝试使用 BayesSearchCV,但出现意外错误。我不使用 iid 参数,但错误一直说 __init__() got an unexpected keyword argument 'iid'。我会在这里分享我的代码

代码

roc_auc = make_scorer(roc_auc_score,greater_is_better=True,needs_threshold=True)
skf = StratifiedKFold(n_splits=5,shuffle=True,random_state=1234)

clf = catboostClassifier(thread_count=2,loss_function='Logloss',od_type = 'Iter',verbose= False
                        )

# Defining your search space
search_spaces = {'iterations': Integer(10,1000),'depth': Integer(1,8),'learning_rate': Real(0.01,1.0,'log-uniform'),'random_strength': Real(1e-9,10,'bagging_temperature': Real(0.0,1.0),'border_count': Integer(1,255),'l2_leaf_reg': Integer(2,30),'scale_pos_weight':Real(0.01,'uniform')}

# Setting up BayesSearchCV
opt = BayesSearchCV(clf,search_spaces,scoring=roc_auc,cv=skf,n_iter=100,n_jobs=1,# use just 1 job with catboost in order to avoid segmentation fault
                    return_train_score=False,refit=True,optimizer_kwargs={'base_estimator': 'GP'}
)

错误信息:

Error

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)