Artificial Intelligence, Artificial Neural Network, Computer Science, Linear Regression, Python.
the number, as follows: [[1, 0, 0], [0, 1, 0], [0, 0, 1]]. TensorFlow provides a function that facilitates this conversion from labels to the one-hot-encoded representation. import tensorflow as tf y_digits= [1, 2, 3] y_digits_one_hot = tf.one_hot(y_digits, 3) #Prints the encoded representation