/// <summary> /// Writes a test report. /// </summary> /// <param name="fileName">The path to a file to write the report to.</param> /// <param name="report">The report to write.</param> /// <param name="mode">Defines the components of the report to write.</param> public static void WriteReport(string fileName, ClassificationReport <T> report, ClassificationReportMode mode) { using (StreamWriter outputFile = File.CreateText(fileName)) { ClassificationReportWriter <T> .WriteReport(outputFile, report, mode); } }
/// <summary> /// Writes a test report into a string. /// </summary> /// <param name="report">The report to write.</param> /// <param name="mode">Defines the components of the report to write.</param> /// <returns> /// The <see cref="string"/> that contains test report. /// </returns> public static string WriteReport(ClassificationReport <T> report, ClassificationReportMode mode) { using (StringWriter stream = new StringWriter()) { ClassificationReportWriter <T> .WriteReport(stream, report, mode); return(stream.ToString()); } }