SFS. fit() got an unexpected keyword argument 'fit_params'

503 views
Skip to first unread message

Vladimir Jastrebov

unread,
Sep 25, 2020, 3:47:32 AM9/25/20
to mlxtend
Python 2.75.
Mlx  0.17.3

Code:
scoring=make_scorer(precision_score, average='weighted')
SFSres = SFS(XGB, k_features=(5, 10), scoring = scoring )
SFSres = SFSres.fit(train_data, train_labels, fit_params={'sample_weight':weights})

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

Where is the mistake?

Sebastian Raschka

unread,
Sep 25, 2020, 10:39:45 AM9/25/20
to mlxtend
Sorry, I just see that the documentation is incorrect and needs to be updated.  Changing 
SFSres.fit(train_data, train_labels, fit_params={'sample_weight':weights}

to 

SFSres.fit(train_data, train_labels, sample_weight=weights)

should fix it

Best,
Sebastian

Vladimir Jastrebov

unread,
Sep 25, 2020, 3:03:08 PM9/25/20
to mlxtend
Thanks for the quick response. Working!

пятница, 25 сентября 2020 г. в 17:39:45 UTC+3, se.ra...@gmail.com:
Reply all
Reply to author
Forward
0 new messages