3 writes to _labelHistogram
Microsoft.ML.StandardTrainers (3)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (3)
298_labelHistogram = labelHistogram; 323_labelHistogram = ctx.Reader.ReadLongArray() ?? new long[0]; 326_labelHistogram = Array.ConvertAll(ctx.Reader.ReadIntArray() ?? new int[0], x => (long)x);
21 references to _labelHistogram
Microsoft.ML.StandardTrainers (21)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (21)
265public IReadOnlyList<int> GetLabelHistogram() => Array.ConvertAll(_labelHistogram, x => (int)x); 270public IReadOnlyList<long> GetLabelHistogramLong() => _labelHistogram; 300_totalTrainingCount = _labelHistogram.Sum(); 301_labelCount = _labelHistogram.Length; 303_absentFeaturesLogProb = CalculateAbsentFeatureLogProbabilities(_labelHistogram, _featureHistogram, _featureCount); 328_labelCount = _labelHistogram.Length; 330foreach (int labelCount in _labelHistogram) 338if (_labelHistogram[iLabel] > 0) 350_totalTrainingCount = _labelHistogram.Sum(); 375ctx.Writer.WriteLongStream(_labelHistogram); 379if (_labelHistogram[i] > 0) 427float[] featureHistogram = new float[_featureHistogram[0].Length * _labelHistogram.Length]; 428float[] labelHistogramExpanded = new float[_featureHistogram[0].Length * _labelHistogram.Length]; 436Array.Copy(_labelHistogram, 0, labelHistogramExpanded, i * _featureHistogram.Length, _featureHistogram.Length); 444var labelHistogram = ctx.AddInitializer(labelHistogramExpanded.Take(_labelHistogram.Length), new long[] { _labelHistogram.Length, 1 }, "labelHistogram"); 447var labelHistogramName = ctx.AddInitializer(labelHistogramExpanded, new long[] { _featureHistogram[0].Length, _labelHistogram.Length }, "labelHistogramExpanded"); 452var typeLabelByFea = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, _featureHistogram[0].Length); 453var typeLabelByOne = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, 1); 607double labelOccurrenceCount = _labelHistogram[iLabel]; 610if (_labelHistogram[iLabel] > 0)