Hello Animesh!



 Animesh_Kumar_Paul:

I have a dataset which has multiple targets attributes.
Sample targets for 6 data points (4 attributes as target outputs: not one-hot encoded):



Just to confirm, are your really working with a “multi-target”
(multi-class) classification problem?  I ask because the sample
targets you show in your .png image have either 0 (in just row 2)
or 1 (in the rest of the rows) of the labels set.
That is, even though you didn’t show such a row, could you have
a row (say, row 17) for which all four fields are set to 1?
If not, you have a multi-class (but not multi-label) classification
problem, and you should recast it as such, and (most likely)
use nn.CrossEntropyLoss as your loss function.


Error: RuntimeError: multi-target not supported at …\aten\src\THNN/generic/ClassNLLCriterion.c:20
How can I train and evaluate the multi-target classification problem?


The general consensus is that MultiLabelSoftMarginLoss 28
is the loss function to start with for a multi-label classification
problem.
Best.
K. Frank