예제 #1
0
 /// <summary>Gets label statistics.</summary>
 /// <param name="y">The Vector to process.</param>
 /// <returns>An array of statistic.</returns>
 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;
 }