All the ways to do one-hot encoding

unique(x) .== permutedims(x)
40 Likes