Python pass class weights to SequentialFeatureSelector?

from mlxtend.feature_selection import SequentialFeatureSelector as SFS

xgboost classifier

XGB = xgboost.XGBClassifier(num_class = 3)

Sets features selection

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

Trying to pass class weights for feature selection

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

result

TypeError: fit() got an unexpected keyword argument ‘fit_params’

How to pass class weights to feature selection?

Answer

“the documentation is incorrect and needs to be updated”

decision:

fit(train_data, train_labels, sample_weight=weights)

Leave a Reply

Your email address will not be published. Required fields are marked *