Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/23/12 15:05:30 (12 years ago)
Author:
ascheibe
Message:

#1886 added relative error and possibility to add fitted line to charts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/RunCollectionStatisticalTabularView.cs

    r8521 r8522  
    156156      string rowName = (string)dataRowComboBox.SelectedItem;
    157157
    158       string[] columnNames = new string[] { "Count", "Minimum", "Maximum", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile", "Gradient", "Absolut Error" };
     158      string[] columnNames = new string[] { "Count", "Minimum", "Maximum", "Average", "Median", "Standard Deviation", "Variance", "25th Percentile", "75th Percentile", "Gradient", "Relative Error" };
    159159
    160160      var runs = Content.Where(x => x.Results.ContainsKey(resultName));
     
    200200      stringConvertibleMatrixView.Content = dt;
    201201    }
     202
     203    private void addLineToChart_Click(object sender, EventArgs e) {
     204      string resultName = (string)dataTableComboBox.SelectedItem;
     205      string rowName = (string)dataRowComboBox.SelectedItem;
     206      var runs = Content.Where(x => x.Results.ContainsKey(resultName));
     207
     208      foreach (Run run in runs) {
     209        DataTable resTable = (DataTable)run.Results[resultName];
     210        DataRow row = resTable.Rows[rowName];
     211        var values = row.Values.ToArray();
     212        double k, d;
     213        LinearLeastSquaresFitting.Calculate(values, out k, out d);
     214
     215        DataRow newRow = new DataRow(row.Name + " Fitted Line");
     216        for (int i = 0; i < values.Count(); i++) {
     217          newRow.Values.Add(k * i + d);
     218        }
     219
     220        if (!resTable.Rows.ContainsKey(newRow.Name))
     221          resTable.Rows.Add(newRow);
     222      }
     223    }
    202224  }
    203225}
Note: See TracChangeset for help on using the changeset viewer.