Franck-Dernoncourt/NeuroNER

Encountered errors while generating plots for the train set

ashikrafi opened this issue · 3 comments

Dear Team,

Would you please help me out regarding the error? I am just stuck.

Thank you

pLOT

You are receiving the error because the script is trying to execute
int('0.0')

https://scikit-learn.org/stable/modules/generated/sklearn.metrics.classification_report.html
If you look in the Examples section, values for support should be int.

https://github.com/scikit-learn/scikit-learn/blob/fd237278e895b42abe8d8d09105cbb82dc2cbba7/sklearn/metrics/_classification.py#L1275
Function precision_recall_fscore_support mentions in the Returns section:

support : None (if average is not None) or array of int, shape =\
        [n_unique_labels]
        The number of occurrences of each label in ``y_true``.

I am not sure why you are getting float instead of int.
Probably you need to check whether its due to some older version of scikit-learn (My guess).
Or it could be that the released version of NeuroNER had some issues which got resolved after the commits post release?

You should try out:

  • Check what's getting returned by sklearn.metrics.classification_report
  • For a quick fix, you can replace support.append(int(t[-1])) with support.append(int(float(t[-1]))) in utils_plots.py

Thank you,it worked.