2 writes to _labelCount
Microsoft.ML.StandardTrainers (2)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (2)
301_labelCount = _labelHistogram.Length; 328_labelCount = _labelHistogram.Length;
13 references to _labelCount
Microsoft.ML.StandardTrainers (13)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (13)
305_outputType = new VectorDataViewType(NumberDataViewType.Single, _labelCount); 335_featureHistogram = new long[_labelCount][]; 336for (int iLabel = 0; iLabel < _labelCount; iLabel += 1) 349_absentFeaturesLogProb = ctx.Reader.ReadDoubleArray(_labelCount); 352_outputType = new VectorDataViewType(NumberDataViewType.Single, _labelCount); 374ctx.Writer.Write(_labelCount); 377for (int i = 0; i < _labelCount; i += 1) 383ctx.Writer.WriteDoublesNoCount(_absentFeaturesLogProb.AsSpan(0, _labelCount)); 442var labelCount = ctx.AddInitializer((float)_labelCount, "labelCount"); 592logProb += Math.Log(featureCount + 1) - Math.Log(labelOccurrenceCount + _labelCount); 593absentFeatureLogProb += Math.Log(absentFeatureCount + 1) - Math.Log(labelOccurrenceCount + _labelCount); 603var editor = VBufferEditor.Create(ref dst, _labelCount); 605for (int iLabel = 0; iLabel < _labelCount; iLabel += 1)