Closed vitalie-cracan closed 6 years ago
Q: the error is obtained when a non-binary classifier is requested, for example "category"?
I get the error for column_to_predict = "ticket_type"
@en-vcracan This is the running log from my side:
runfile('C:/D/workspace/Support-Tickets-Classification/2_train_and_eval_model.py', wdir='C:/D/workspace/Support-Tickets-Classification') Shape of dataset before removing classes with less then 1 rows: (48549, 9) Number of classes before removing classes with less then 1 rows: 2 Shape of dataset after removing classes with less then 1 rows: (48549, 9) Number of classes after removing classes with less then 1 rows: 2 Training LGB classifier Evaluating model Confusion matrix without GridSearch: [[2583 179] [ 49 6899]] Mean without GridSearch: 0.976519052523

precision recall f1-score support
0 0.98 0.94 0.96 2762
1 0.97 0.99 0.98 6948
avg / total 0.98 0.98 0.98 9710
Also, the parameters are specifying that a multiclass type of classification is requested clf = LGBMClassifier( boosting_type='gbdt', objective='multiclass', learning_rate=0.01, colsample_bytree=0.9, subsample=0.8, random_state=1, n_estimators=100, num_leaves=31, silent=False)
@en-vcracan Could you please try if with adding this to parameters: eval_metric='multi-logloss', you still get the error ?
Odd. Could you confirm the version of lightgbm on your machine? According to the docs to the latest version, num_class
parameter is required for multiclass
classifier.
https://lightgbm.readthedocs.io/en/latest/Parameters.html#core-parameters
I confirm that I get same error when I add eval_metric='multi-logloss'
Addittionally, I get this warning:
[LightGBM] [Warning] Unknown parameter: eval_metric
I realized that I was using lightgbm 2.0.10 while the last one is 2.1.2. For the moment, until I fix the issue, please use (if available) lightgbm 2.0.10. Thank you for raising it.
I get the following error when
classifier = "LGB"
: