2 writes to _featureHistogram
Microsoft.ML.StandardTrainers (2)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (2)
299_featureHistogram = featureHistogram; 335_featureHistogram = new long[_labelCount][];
25 references to _featureHistogram
Microsoft.ML.StandardTrainers (25)
Standard\MulticlassClassification\MulticlassNaiveBayesTrainer.cs (25)
277public IReadOnlyList<IReadOnlyList<int>> GetFeatureHistogram() => Array.ConvertAll(_featureHistogram, x => Array.ConvertAll(x, y => (int)y)); 282public IReadOnlyList<IReadOnlyList<long>> GetFeatureHistogramLong() => _featureHistogram; 303_absentFeaturesLogProb = CalculateAbsentFeatureLogProbabilities(_labelHistogram, _featureHistogram, _featureCount); 341_featureHistogram[iLabel] = ctx.Reader.ReadLongArray(_featureCount); 343_featureHistogram[iLabel] = Array.ConvertAll(ctx.Reader.ReadIntArray(_featureCount) ?? new int[0], x => (long)x); 345Host.CheckDecode(_featureHistogram[iLabel][iFeature] >= 0); 380ctx.Writer.WriteLongStream(_featureHistogram[i]); 427float[] featureHistogram = new float[_featureHistogram[0].Length * _labelHistogram.Length]; 428float[] labelHistogramExpanded = new float[_featureHistogram[0].Length * _labelHistogram.Length]; 430for (int i = 0; i < _featureHistogram.Length; i++) 432Array.Copy(_featureHistogram[i], 0, featureHistogram, i * _featureHistogram[i].Length, _featureHistogram[i].Length); 434for (int i = 0; i < _featureHistogram[0].Length; i++) 436Array.Copy(_labelHistogram, 0, labelHistogramExpanded, i * _featureHistogram.Length, _featureHistogram.Length); 446var featureHistogramName = ctx.AddInitializer(featureHistogram, new long[] { _featureHistogram.Length, _featureHistogram[0].Length }, "featureHistogram"); 447var labelHistogramName = ctx.AddInitializer(labelHistogramExpanded, new long[] { _featureHistogram[0].Length, _labelHistogram.Length }, "labelHistogramExpanded"); 451var typeFea = new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length); 452var typeLabelByFea = new VectorDataViewType(NumberDataViewType.Single, _labelHistogram.Length, _featureHistogram[0].Length); 455var greaterOutput = ctx.AddIntermediateVariable(new VectorDataViewType(BooleanDataViewType.Instance, _featureHistogram[0].Length), "greaterOutput"); 466var isFeaturePresent = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, 1, _featureHistogram[0].Length), "isFeaturePresent"); 576var logOutput = ctx.AddIntermediateVariable(new VectorDataViewType(NumberDataViewType.Single, _featureHistogram[0].Length), "LogOutput"); 589double featureCount = _featureHistogram[labelIndex][featureIndex];