All the ways to do one-hot encoding

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