Example #1
0
        /* Updating progress of classification test method thread */
        private void WatchClassificationTestThreadProgress(object source, EventArgs e)
        {
            pbTesting2.Value = Testing.Progress;
            if (_graph != null)
            {
                _timer.Stop();

                // Draw
                GraphForm graphForm = new GraphForm(_graph);
                graphForm.Show();

            }
        }
Example #2
0
        private void PlotLearningCurve(Testing.CurvePoint[] learningCurve, out GraphForm graphFormS, out GraphForm graphFormFn, out GraphForm graphFormFp, double[] simpleAlgorithm, bool excludeLearnedFromTestingSet)
        {
            // Create 3 new graphs
               GraphForm.GraphPlot graphSuccess = new GraphForm.GraphPlot("TrainingSet", "Success");
               GraphForm.GraphPlot graphFN = new GraphForm.GraphPlot("TrainingSet", "False Negative");
               GraphForm.GraphPlot graphFP = new GraphForm.GraphPlot("TrainingSet", "False Positive");
               graphSuccess.setUsedForLearningCurve(true);
               graphFN.setUsedForLearningCurve(true);
               graphFP.setUsedForLearningCurve(true);

               // add point (0,0)
               graphSuccess.addPoint(0, 0, "", Color.Black);
               graphFN.addPoint(0, 0, "", Color.Black);
               graphFP.addPoint(0, 0, "", Color.Black);
               foreach (Testing.CurvePoint p in learningCurve)
               {
               graphSuccess.addPoint(p.getTrainingSetPercentage(), p.getAvgPercentageCorrect(), Math.Round(p.getStdPercentageCorrect(), 2).ToString(), Color.Black);
               graphFN.addPoint(p.getTrainingSetPercentage(), p.getAvgPercentageFalseNegative(), Math.Round(p.getStdPercentageFalseNegative(), 2).ToString(), Color.Black);
               graphFP.addPoint(p.getTrainingSetPercentage(), p.getAvgPercentageFalsePositive(), Math.Round(p.getStdPercentageFalsePositive(), 2).ToString(), Color.Black);
               }
               // add point (100,100) or (100,0)
               graphSuccess.addPoint(100, 100, "", Color.Black);
               graphFN.addPoint(100, 0, "", Color.Black);
               graphFP.addPoint(100, 0, "", Color.Black);

               //add comparison line for statistical simple algorithms
               string partially = (excludeLearnedFromTestingSet) ? "" : "partially_statistical";
               graphSuccess.addComparisonLines(simpleAlgorithm[0], "statistical", partially);
               graphFN.addComparisonLines(simpleAlgorithm[1], "statistical", partially);
               graphFP.addComparisonLines(simpleAlgorithm[2], "statistical", partially);

               // Draw
               graphFormS = new GraphForm(graphSuccess);
               graphFormFn = new GraphForm(graphFN);
               graphFormFp = new GraphForm(graphFP);
               graphFormS.Show();
               graphFormFn.Show();
               graphFormFp.Show();
        }