Как передать веса классов в SequentialFeatureSelector?

from mlxtend.feature_selection import SequentialFeatureSelector as SFS

Модель xgboost classifier

XGB = xgboost.XGBClassifier(num_class = 3)

Настраиваю отбор признаков

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

Пытаюсь передать веса классов для отбора признаков через sample_weight

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

получаю

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

Как передать веса классов в отбор признаков?


Ответы (1 шт):

Автор решения: Анна Лебедева

"the documentation is incorrect and needs to be updated"

решение:

fit(train_data, train_labels, sample_weight=weights)
→ Ссылка