TeamHG-Memex / sklearn-crfsuite

scikit-learn inspired API for CRFsuite
424 stars 217 forks source link

flat_classification_report seems to be broken #66

Open chriswales95 opened 2 years ago

chriswales95 commented 2 years ago

Hi,

it appears that flat_classification_report is now broken. Scikit-learn's classification_report no longer uses positional arguments anymore and was deprecated prior a while back. It seems this is now being enforced.

Specifically, the issue is that labels are no longer a positional argument and is instead a keyword argument.

It seems to be a simple fix so I can submit a pull request later.

chriswales95 commented 2 years ago

I've opened a pull request.

https://github.com/TeamHG-Memex/sklearn-crfsuite/pull/67

tkngoutham commented 1 year ago

This bug is not fixed yet. Kindly some one do the merge and let the issue gets resolved

PawanKrGunjan commented 1 year ago

metrics.flat_classification_report(test_labels, y_pred, labels=labels, digits=3)

TypeError: classification_report() takes 2 positional arguments but 3 positional arguments (and 1 keyword-only argument) were given

drizk1 commented 1 year ago

so is there still no fix?

PawanKrGunjan commented 1 year ago

`from sklearn_crfsuite.utils import flatten

print(metrics.flat_classification_report(y_test, y_pred, labels=sorted_labels, digits=3 ) )`

Check this notebook: https://www.kaggle.com/code/pawankumargunjan/sklearn-crfsuite