Python 将 class 权重传递给 SequentialFeatureSelector?

Python pass class weights to SequentialFeatureSelector?

from mlxtend.feature_selection import SequentialFeatureSelector as SFS

xgboost class化器

XGB = xgboost.XGBClassifier(num_class = 3)

设置特征选择

SFSres = SFS(XGB, k_features=8,cv=5)

正在尝试传递 class 权重以进行特征选择

SFSres = SFSres.fit(train_data, train_labels, fit_params={'sample_weight':weights})

结果

TypeError: fit() got an unexpected keyword argument 'fit_params'

如何将 class 权重传递给特征选择?

"the documentation is incorrect and needs to be updated"

决定:

fit(train_data, train_labels, sample_weight=weights)