-
Hello,
My question is: Why are we setting the output_features to 4? Shouldn't it be 1? Yes, I know we have 4 classes but we want the model to output 1 number (0-3 based on which class does it belong to). Similarly, when we were building the binary classification model, we set the final out_features=1 and not 2, even though we had 2 categories because we wanted the model to output 1 number. Can anyone explain what is happening here as these seem like 2 contradicting statements? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@dehlong In multiclass classification, there r more than two classes to predict. We set |
Beta Was this translation helpful? Give feedback.
@dehlong
In binary classification, there r only two values to predict: either 1 or 0 (positive or negative). The raw logits r passed through a sigmoid function for binary classification, which produces a single output representing the probability of the positive class.
In multiclass classification, there r more than two classes to predict. We set
n
outputs, where each element in that output representing the score or probability for each class when passed through the softmax function. The class with the highest probability is chosen as the prediction.