to_categorical | R Documentation |
Converts a class vector (integers) to binary class matrix.
to_categorical(y, num_classes = NULL, dtype = "float32")
y |
Class vector to be converted into a matrix (integers from 0 to num_classes). |
num_classes |
Total number of classes. |
dtype |
The data type expected by the input, as a string |
E.g. for use with loss_categorical_crossentropy()
.
A binary matrix representation of the input.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.