Using deep metric learning for imbalanced dataset #637
-
Hi Kevin! Thanks for creating such a powerful library! I have a question regarding using deep metric learning for imbalanced dataset. I used trainWithClassifier with triplet loss, and used optuna with cross validation for hyper-parameter tuning. Based on the confusion matrix, the test set results looks ok to me. Below is how i get the score:
Do you have any intuition why the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It's low because if there are say 1500 relevant items, and 1497 of them aren't retrieved, it gets penalized for that regardless of the value of (from https://nlp.stanford.edu/IR-book/pdf/08eval.pdf) Try setting |
Beta Was this translation helpful? Give feedback.
-
Thanks for your answer, Kevin! Just to clarify, do you mean that in my case, assuming my only test case is the image with label 0 (the major class) and there are 1500 train images with label 0, |
Beta Was this translation helpful? Give feedback.
-
Great. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
It's low because if there are say 1500 relevant items, and 1497 of them aren't retrieved, it gets penalized for that regardless of the value of
k
:(from https://nlp.stanford.edu/IR-book/pdf/08eval.pdf)
Try setting
k=None
so that it finds all nearest neighbors instead of just the closestk
.