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

Emmanuel confusion matrix #833

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open

Conversation

tomasoignons
Copy link
Collaborator

This pull request add a confusion matrix to the testing page

image
image

The confusion matrix has been made so that it works with multiple class classfication, and not only binary classification.

This pull request modify the Validator class in the discoJS library, in order to retrieve

  • If the element was correctly predicted
  • The prediction
  • the original label of the element

Added the feature in the library and in the webapp so that when we test from the webapp, it return the predicted element, and if it was correct or no
This commit add
- the fact that the validator return you the correct prediction
- the confusion matrix (for the moment, with the labels as numbers, and whithout light mode) in the test page statistics
- the confusion matrix is extendable (it works not only for boolean, but also for multi classification)
- Move the confusion matrix into her own space
- Add dark mode support for the confusion matrix
- Add the labels as the title of the confusion matrix, instead of "1" or "2" (the labels have to be predicted at least once)
@JulienVig
Copy link
Collaborator

Hi @tomasoignons! Thanks for the PR! I'm super busy these days so I can maybe review it next week.
Could you add a screenshot of how it looks like for MNIST? (when there are more categories)

@tomasoignons
Copy link
Collaborator Author

tomasoignons commented Dec 5, 2024

I had to train my own model, because we don't have the MNIST on the models available as a simple demo, and it looks really good in my opinion :

image

And in light mode :
image

Copy link
Collaborator

@tharvik tharvik left a comment

Choose a reason for hiding this comment

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

thanks for the nicer test visualisation, love a table filling up of data!
I've got a few comments on how it can be tidier but the overall feature is great!

I also got a bunch of errors toaster at the start of the test:TypeError: matrix[output.predicted] is undefined

webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
discojs/src/validator.ts Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
webapp/src/components/testing/TestSteps.vue Outdated Show resolved Hide resolved
@tomasoignons
Copy link
Collaborator Author

I have no clue why I don't pass the timeout here, maybe my code is suboptimal, or the postprocess takes longer and I am just above, if @JulienVig or @tharvik could check this point (not review the whole merge request, just check why the test fails, because I try random things, but the test seems to work fine until the last bit) if would be perfect.

@tharvik
Copy link
Collaborator

tharvik commented Dec 18, 2024

I have no clue why I don't pass the timeout here

ho, yeah, some integration tests are a bit flaky, fell free to retry the CI/CD workflow if it doesn't look like it's coming from your code.
in this specific case, I think that it comes from the postprocess pass which wasn't needed in the previous implementation, so it's not the test flakiness. you can double the timeout of the validator/"can read and predict randomly on simple_face" test (we only care that it finishes, not that it does it fast, we would need benchmark for that)

@tomasoignons tomasoignons requested a review from tharvik December 23, 2024 00:10
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