In accordance with the comments and ideas from them, I suspected the values of the matrix. So I researched it:

As shown in the figure above, some lines have zero values. The input matrix is generated by Codification, which is used in the examples here:
NaiveBayes
with documents below:
Coding Documentation
codification -1 was null. Like the screenshot below:

So my solution replaced null with "null" . But there may be better solutions.
Now the calling method containing fixed data looks like this:
public LearningResultViewModel Learn(EMVDBContext dBContext, string userId, LearningAlgorithm learningAlgorithm) { var learningDataRaw = dBContext.Mutants .Include(mu => mu.MutationOperator) .Where(mu => mu.Equivalecy == 0 || mu.Equivalecy == 10); string[] featureTitles = new string[] { "ChangeType", "OperatorName", "OperatorBefore", "OperatorAfter", }; string[][] learningInputNotCodified = learningDataRaw.Select(ldr => new string[] { ldr.ChangeType.ToString(), ldr.MutationOperator.Name??"null", ldr.MutationOperator.Before??"null", ldr.MutationOperator.After??"null", }).ToArray(); int[] learningOutputNotCodified = learningDataRaw.Select(ldr => ldr.Equivalecy == 0 ? 0 : 1).ToArray(); #region Codification phase // Create a new codification codebook to // convert strings into discrete symbols Codification codebook = new Codification(featureTitles, learningInputNotCodified); // Extract input and output pairs to train int[][] learningInput = codebook.Transform(learningInputNotCodified); switch (learningAlgorithm) { case LearningAlgorithm.NaiveBayesian: return learningService.NaiveBayes(learningInput, learningOutputNotCodified); break; case LearningAlgorithm.SVM: break; default: break; } #endregion return null; }
I would like this to help others facing the same problem.
source share