Function matrixNumericalEncoding

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

    Parameters

    • matrixInitial: (string | number)[][]

      original matrix before encoding

    Returns {
        dictCategoricalToNumerical: Record<string, number>;
        matrix: number[][];
    }

    • dictionary from string to number
    • dictCategoricalToNumerical: Record<string, number>
    • matrix: number[][]