Interpreting Multi Task Classifier output

The Multi-Task Classifier in deepchem gives an output of shape (n_samples,n_tasks,n_classes). How do I get class labels as a prediction from it? I am not able to get precision and recall score from the default output format of the Multi-Task Classifier. Can someone help?

1 Like

You can pull out the predictions for a given task to get an array of shape (n_samples, n_classes). If your task is binary, you can convert to class labels by thresholding. For multiclass, you generally have to do something a little trickier (perhaps picking the highest class score as the label).

The output is a probability distribution rather a precise prediction. Element (x, y, z) is the probability that task y for sample x is in class z.

2 Likes

Just a follow-up on this. My task is binary classification and I am getting two probability values for each sample. How do I know which value corresponds to which class? Eg. if there are 2 samples and 2 classes 0 and 1, the output Iā€™m getting is something like this [[0.4,0.6],[0.82,0.18]]. Do the values 0.4 and 0.82 correspond to class 0 or class 1?