def categorical_to_binary(x):
    n_col = (np.amax(x) + 1)
    binarized = np.zeros((len(x), n_col))
    for i in range(len(x)):
        binarized[(i, x[i])] = 1
    return binarized
def categorical_to_binary(x):
    n_col = (np.amax(x) + 1)
    binarized = np.zeros((len(x), n_col))
    for i in range(len(x)):
        binarized[(i, x[i])] = 1
    return binarized