Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metrics functions gives 'numpy.int64' object is not iterable #46

Open
yonatanbitton opened this issue Mar 25, 2020 · 1 comment
Open

Comments

@yonatanbitton
Copy link

Hi

I want to do simple usage of your function.

My data, y_pred and y_test are lists of lists, in length of 50.
(Each inner list in different length)

a. res = sklearn_crfsuite.metrics.flat_classification_report(y_test, y_pred, digits=3)

Traceback (most recent call last):
  File "C:\Users\PC-1\.conda\envs\KerasEnv36\lib\site-packages\IPython\core\interactiveshell.py", line 3325, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-5-b25a149ce4c7>", line 1, in <module>
    res = sklearn_crfsuite.metrics.flat_classification_report(y_test, y_pred, digits=3)
  File "C:\Users\PC-1\.conda\envs\KerasEnv36\lib\site-packages\sklearn_crfsuite\metrics.py", line 11, in wrapper
    y_true_flat = flatten(y_true)
  File "C:\Users\PC-1\.conda\envs\KerasEnv36\lib\site-packages\sklearn_crfsuite\utils.py", line 12, in flatten
    return list(chain.from_iterable(y))
TypeError: 'numpy.int64' object is not iterable

What is the problem ? Thanks

@asfakali
Copy link

I got same issue. Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants