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

Fix WIT multiclass confusion matrix #2256

Merged
merged 1 commit into from
May 22, 2019
Merged

Conversation

jameswex
Copy link
Contributor

@jameswex jameswex commented May 21, 2019

  • Motivation for features / changes

In certain cases the confusion matrix was missing entries.

  • Technical description of changes

Correctly add both the inferred label and the true label to the set of all labels to show in the multiclass confusion matrix, including coercing all labels to strings.

  • Screenshots of UI changes

fixconfmatrix

  • Detailed steps to verify changes work correctly (as executed by you)

Verified continued correct working in multiclass demo, and verified correct behavior in multiclass colab notebook that displayed this issue.

@jameswex
Copy link
Contributor Author

@tolga-b please review

@jameswex jameswex requested a review from stephanwlee May 21, 2019 18:18
@@ -3176,8 +3176,8 @@ <h2>Show similarity to selected datapoint</h2>
const modelInferenceValueStr =
this.strWithModelName_(inferenceValueStr, modelInd);
let count = statsActual[item[modelInferenceValueStr]];
allLabels.add(item[modelInferenceValueStr]);
allLabels.add(item[modelInferenceValueStr]);
allLabels.add(String(item[modelInferenceValueStr]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious: what happens if you don't explicitly cast it to string?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For users that provide "ground truth class ID" as a number to WIT, you may get a confusion matrix where rows and columns are doubled, that is that there is a row for Predicted class 0 (as an int) and a row for Prediction class 0 (as a string) separately. They both contain the same correct numbers for those confusion matrix cells, but the rows and columns are duplicated leading to an overly large and confusing confusing matrix.

@jameswex jameswex merged commit f170b86 into tensorflow:master May 22, 2019
@jameswex jameswex deleted the witarray branch May 22, 2019 15:30
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

Successfully merging this pull request may close these issues.

3 participants