public override void writeToFile(TextWriter handle, string path)
        {
            Utils.Table overall = new Utils.Table(new string[] { "Pipeline", "Classification Quality", "Grouping Quality", "Recognition Quality" });
            handle.WriteLine("Overall results");
            int pipelineID = 0;

            foreach (RecognitionPipeline pipeline in _pipelines)
            {
                pipelineID++;
                overall.addResult(new string[] {
                    "" + pipelineID,
                    "" + _cls[pipeline] / _numTests,
                    "" + _grp[pipeline] / _numTests,
                    "" + _rec[pipeline] / _numTests
                });
            }
            overall.writeCSV(handle);
            handle.WriteLine();

            pipelineID = 0;
            foreach (RecognitionPipeline pipeline in _pipelines)
            {
                pipelineID++;
                handle.WriteLine("Pipeline " + pipelineID);
                _classificationConfusion[pipeline].writeCSV(handle);
                _recognitionConfusion[pipeline].writeCSV(handle);
                _tables[pipeline].writeCSV(handle);
                handle.WriteLine();
            }
        }
Exemple #2
0
        public override void finalize(TextWriter handle, string path)
        {
            Utils.Table overall = new Utils.Table(new string[] {
                "Pipeline",
                "Classification Quality",
                "Grouping Quality",
                "Recognition Quality",
                "Real Recognition Quality",
                "Per-substroke Recognition Quality"
            });
            handle.WriteLine("Overall results");
            foreach (RecognitionPipeline pipeline in _pipelines)
            {
                overall.addResult(new string[] {
                    "" + pipelineId(pipeline),
                    "" + _cls[pipeline] / _numTests,
                    "" + _grp[pipeline] / _numTests,
                    "" + _rec[pipeline] / _numTests,
                    "" + _realRec[pipeline] / _numTests,
                    "" + _srec[pipeline] / _numTests
                });
            }
            overall.writeCSV(handle);
            handle.WriteLine();

            foreach (RecognitionPipeline pipeline in _pipelines)
            {
                handle.WriteLine("Pipeline " + pipelineId(pipeline));
                _classificationConfusion[pipeline].writeCSV(handle);
                _recognitionConfusion[pipeline].writeCSV(handle);
                _tables[pipeline].writeCSV(handle);
                handle.WriteLine();
            }
        }
 private void prepForPipeline(RecognitionPipeline pipeline)
 {
     _pipelines.Add(pipeline);
     Utils.Table table = new Utils.Table(new string[] { "File", "Classification Quality", "Grouping Quality", "Recognition Quality" });
     _tables.Add(pipeline, table);
     _cls.Add(pipeline, 0);
     _grp.Add(pipeline, 0);
     _rec.Add(pipeline, 0);
 }