to_categorical | R Documentation |
This function takes a vector or 1 column matrix of class labels and converts it into a matrix with p columns, one for each category. This is the format most commonly used in the fitting and predicting of neural networks.
to_categorical(y, num_classes = NULL)
y |
class vector to be converted into a matrix (integers from 0 to num_classes). |
num_classes |
total number of classes. Set to |
Taylor B. Arnold, taylor.arnold@acm.org
Chollet, Francois. 2015. Keras: Deep Learning library for Theano and TensorFlow.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.