Numerically encodes the strings in the matrix and returns an encoding dictionary which can be used to encode other matrices
original matrix before encoding
Numerically encodes the strings in the matrix and returns an encoding dictionary which can be used to encode other matrices