tf.keras.utils.to_categorical

Converts a class vector (integers) to binary class matrix.

Used in the notebooks

Used in the guide Used in the tutorials

E.g. for use with categorical_crossentropy.

y class vector to be converted into a matrix (integers from 0 to num_classes).