WillKoehrsen / feature-selector

Feature selector is a tool for dimensionality reduction of machine learning datasets
GNU General Public License v3.0
2.23k stars 768 forks source link

How to use feature-selector for 3 classes #51

Open chawengs opened 2 years ago

chawengs commented 2 years ago

Hi Will, Thanks for your feature selector tool. It work fine for 2 classes feature selection. I have tried to use for 3 classes. It reports error as details.

LightGBMError: Multiclass objective and metrics don't match

Do you know how to fix it

Regards, Chaweng

code-yuan-shi commented 1 year ago

Have you solved it yet? if yes, how to?

code-yuan-shi commented 1 year ago

基本确定了,eval_metric设定为AUC导致报错的(AUC不支持多分类吧),删除掉这个参数或者指定为logloss等评估指标就可以了

chawengs commented 1 year ago

You can try to remove eval_metric = eval_metric

from: model.fit(train_features, train_labels, eval_metric = eval_metric,eval_set = [(valid_features, valid_labels)],early_stopping_rounds = 100, verbose = -1)

to:

model.fit(train_features, train_labels, eval_set = [(valid_features, valid_labels)],early_stopping_rounds = 100, verbose = -1)