Published
- 1 min read
reverse one hot encoding python numpy
The solution for this is noted below
reverse one hot encoding python numpy
Solution
import numpy as np
class_labels = np.argmax(class_prob, axis=1) # assuming you have n-by-5 class_prob
Try other methods by searching on the site. That is if this doesn’t work