'How to capture index of highest valued array from predict function?
[[0.12673968 0.15562803 0.03175346 0.6858788 ]]
This is how my predict function is giving its output, I want to fetch the index of the highest value.
Tried this:
pred= pred.tolist() print(max(pred)) index_l=pred.index(max(pred)) print(index_l)
But it seems to output only 0.
Printing max(pred) is giving the output: [0.12673968076705933, 0.1556280255317688, 0.031753458082675934, 0.6858788132667542]
The network uses sequential with hidden layers (embedding, BiLSTM, BiLSTM, Dense, Dense)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
