Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/16 18:26:24 (8 years ago)
Author:
bburlacu
Message:

#2635: Add evaluator option to aggregate statistics during evaluation (slower). Improve analyzer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.OSGAEvaluator/HeuristicLab.OSGAEvaluator/OSGAPredictionCountsAnalyzer.cs

    r14104 r14231  
    4444
    4545      ResultCollection predictionResults;
    46       DataTable rejectedStatsTable, totalStatsTable;
     46      DataTable rejectedStatsTable, totalStatsTable, rejectedStatsPerGenerationTable, nonRejectedStatsPerGenerationTable;
    4747      if (!ResultCollection.ContainsKey("OS Prediction")) {
    4848        predictionResults = new ResultCollection();
     
    5757        }
    5858        predictionResults.Add(new Result("Total Stats", totalStatsTable));
    59 
     59        rejectedStatsPerGenerationTable = new DataTable("Rejected Per Generation");
     60        nonRejectedStatsPerGenerationTable = new DataTable("Non Rejected Stats per Generation");
     61        foreach (var rowName in rejectedStats.RowNames) {
     62          rejectedStatsPerGenerationTable.Rows.Add(new DataRow(rowName) { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Line, LineWidth = 1 } });
     63          rejectedStatsPerGenerationTable.Rows[rowName].Values.Add(0d);
     64          nonRejectedStatsPerGenerationTable.Rows.Add(new DataRow(rowName) { VisualProperties = { StartIndexZero = true, ChartType = DataRowVisualProperties.DataRowChartType.Line, LineWidth = 1 } });
     65          nonRejectedStatsPerGenerationTable.Rows[rowName].Values.Add(0d);
     66        }
     67        predictionResults.Add(new Result("Rejected Stats Per Generation", rejectedStatsPerGenerationTable));
     68        predictionResults.Add(new Result("Non Rejected Stats Per Generation", nonRejectedStatsPerGenerationTable));
    6069        ResultCollection.Add(new Result("OS Prediction", predictionResults));
    6170      } else {
     
    6372        rejectedStatsTable = (DataTable)predictionResults["Rejected Stats"].Value;
    6473        totalStatsTable = (DataTable)predictionResults["Total Stats"].Value;
     74        rejectedStatsPerGenerationTable = (DataTable)predictionResults["Rejected Stats Per Generation"].Value;
     75        nonRejectedStatsPerGenerationTable = (DataTable)predictionResults["Non Rejected Stats Per Generation"].Value;
    6576      }
    6677
    6778      int i = 0;
    6879      foreach (var rowName in rejectedStats.RowNames) {
    69         // add a padding zero below to prevent columns from being cut off to the left
     80        // pad values with a 0 on each side to prevent clipping
    7081        rejectedStatsTable.Rows[rowName].Values.Replace(new[] { 0d }.Concat(Enumerable.Range(0, rejectedStats.Columns).Select(j => (double)rejectedStats[i, j])).Concat(new[] { 0d }));
    7182        ++i;
     
    7485      foreach (var rowName in totalStats.RowNames) {
    7586        totalStatsTable.Rows[rowName].Values.Replace(new[] { 0d }.Concat(Enumerable.Range(0, totalStats.Columns).Select(j => (double)totalStats[i, j])).Concat(new[] { 0d }));
     87        var row = rejectedStatsPerGenerationTable.Rows[rowName];
     88        var sum = row.Values.Sum();
     89        row.Values.Add(totalStats[i, 0] - sum);
     90        row = nonRejectedStatsPerGenerationTable.Rows[rowName];
     91        sum = row.Values.Sum();
     92        row.Values.Add(totalStats[i, 1] - sum);
    7693        ++i;
    7794      }
Note: See TracChangeset for help on using the changeset viewer.