OneHot To Categorical
Description
Converts one-hot vectors back to categorical values. Type : polymorphic.
Documentation illustration (illustration unavailable in the archive).
Input parameters
data : array, a tensor containing one‑hot encoded data or class probabilities along one axis. The size of the axis specified in axis corresponds to the number of classes.
axis : integer, the axis along which the class dimension is located. The function will search for the index of the maximum value along this axis to determine the categorical label.
Output parameters
percentage : array, tensor containing the maximum value along the specified axis for each element (e.g. the confidence or probability of the predicted class).
label : array, tensor of integer class indices obtained by taking the argmax along the specified axis. This is the categorical label corresponding to the one‑hot encoding.
Use cases
The one-hot to categorical function is used to convert a one-hot encoded vector back into its original categorical label. This is useful during post-processing, for example, to interpret the output of a classification model and display the predicted class name or index.
Example
All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
