Huggingface transformers classification using num_labels 1 vs 2
question 1)For a binary classification problem I could usenum_labelsas 1 (positive or not) or 2 (positive and negative). Is there any guideline regarding which setting is better? It seems that if we use 1 then probability would be calculated usingsigmoidfunction and if we use 2 then probabilities would be calculated usingsoftmaxfunction.question 2)In both cases are my y labels going to be same? each data point will have 0 or 1 and not one hot encoding? For example, if I have 2 data points then y would be0,1and not[0,0],[0,1]I have very unbalanced classification problem where class 1 is present only 2% of times. In my training data I am oversampling
2022-08-19T17:02:40Z
For Question 1 I am wondering the same thing. Although the docs all use num_labels=2 for binary classification, I am currently using num_labels=1. Hope to know if there are any differences.