예제 #1
0
 /// <summary>
 /// Writes a short report that includes accept rate, accept count, and total count.
 /// </summary>
 /// <param name="writer">A stream to write the report to.</param>
 /// <param name="statistics">A classification statistics to get report data from.</param>
 private static void WriteShortStatistics(TextWriter writer, ClassificationStatistics statistics)
 {
     writer.Write(
         ShortFormat,
         statistics.Count,
         Percentage(statistics.Accepted, statistics.Count),
         statistics.Accepted);
 }
예제 #2
0
 /// <summary>
 /// Writes a long report that includes accept rate, accept count, total count, error rate, error count, valid rate, and valid count.
 /// </summary>
 /// <param name="writer">A stream to write the report to.</param>
 /// <param name="statistics">A classification statistics to get report data from.</param>
 private static void WriteLongStatistics(TextWriter writer, ClassificationStatistics statistics)
 {
     writer.Write(
         LongFormat,
         statistics.Count,
         Percentage(statistics.Accepted, statistics.Count),
         statistics.Accepted,
         Percentage(statistics.Errors, statistics.Accepted),
         statistics.Errors,
         Percentage(statistics.Valid, statistics.Count),
         statistics.Valid);
 }
예제 #3
0
        /// <inheritdoc />
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(null, obj))
            {
                return(false);
            }

            if (object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            ClassificationStatistics other = obj as ClassificationStatistics;

            if (other == null)
            {
                return(false);
            }

            return(this.Count == other.Count &&
                   this.Valid == other.Valid &&
                   this.Accepted == other.Accepted &&
                   this.Errors == other.Errors);
        }