numl.Supervised.NaiveBayes.NaiveBayesGenerator.GetLabelStats C# (CSharp) Méthode

GetLabelStats() private méthode

Gets label statistics.
private GetLabelStats ( Vector y ) : numl.Supervised.NaiveBayes.Statistic[]
y numl.Math.LinearAlgebra.Vector The Vector to process.
Résultat numl.Supervised.NaiveBayes.Statistic[]
        private Statistic[] GetLabelStats(Vector y)
        {
            var stats = y.Stats();
            Statistic[] statistics = new Statistic[stats.Rows];
            for (int i = 0; i < statistics.Length; i++)
            {
                double yVal = stats[i, 0];
                var s = Statistic.Make(Descriptor.Label.Convert(stats[i, 0]).ToString(), yVal);
                s.Count = (int)stats[i, 1];
                s.Probability = stats[i, 2];
                statistics[i] = s;
            }
            return statistics;
        }