Issues using Keras np_utils.to_categorical

I’m trying to make an array of one-hot vector of integers into an array of one-hot vector that keras will be able to use to fit my model. Here’s the relevant part of the code:

Y_train = np.hstack(np.asarray(dataframe.output_vector)).reshape(len(dataframe),len(output_cols))
dummy_y = np_utils.to_categorical(Y_train)

Below is an image showing what Y_train and dummy_y actually are.

I couldn’t find any documentation for to_categorical that could help me.

Thanks in advance.

Leave a Comment