After using get_preds
I get a list of tensors. Something like:
[
[0.9, 0.1],
[0.85, 0.15],
[0.92, 0.08],
...
]
And my classes are [0,1]. How should I translate these tensors to the corresponding (the most likely) class? Please see my current approach below
probs = learn.get_preds(ds_type=DatasetType.Test)[0]
def probs2class(item):
return max(range(len(item)), key=item.__getitem__)
print(map(probs2class, probs))
I searched the documentation like crazy but maybe for wrong terms? What is the general way to go from probs to class predictions?