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

Can't use tfdf with keras.metrics.AUC when using one-hot encoding labels #76

Open
mainguyenanhvu opened this issue Jan 17, 2022 · 1 comment

Comments

@mainguyenanhvu
Copy link

I had issue with keras.metrics.AUC(name='auc', multi_label=True, num_labels=4).

It completed training and returned error:

ValueError: Number of labels is not consistent..  Specified by tensor ExpandDims:0 dimension 1.  Tensor assert_shapes/ReadVariableOp:0 dimension 1 must have size 1.  Received size 4, shape (200, 4)

Please help me to solve it.

@achoum
Copy link
Collaborator

achoum commented Jan 19, 2022

Hi,

Can you detail what you are trying to do with multi_label and how is your model configured?

Points to explore:

  • Note that AUC is fundamentally a binary classification method. Are you trying to solve a multi-class or a binary-multi-label task? How would you want this AUC to be computed?
  • TF-DF supports binary and multi-class classification. However it does not support multi-label classification. However, you can combine multiple TF-DF models into a multi-label model.
  • The signature of keras's AUC (see https://www.tensorflow.org/api_docs/python/tf/keras/metrics/AUC) is not well documented in the case of multi-label. I would run some tests to determine what the shape of the predictions should be in your case. You can then check the shape of the model's predictions and see if they match.

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

No branches or pull requests

2 participants