Changeset 12845


Ignore:
Timestamp:
08/11/15 15:35:43 (4 years ago)
Author:
ascheibe
Message:

#2440 fixed KeyNotFoundException in StatisticalTestsView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Analysis.Statistics.Views/3.3/StatisticalTestsView.cs

    r12690 r12845  
    275275        data = new double[columnNames.Count()][];
    276276
     277        if (!groups.Any() || !columnNames.Any()) {
     278          return;
     279        }
     280
    277281        DoubleMatrix dt = new DoubleMatrix(groups.Select(x => x.Count()).Max(), columnNames.Count());
    278282        dt.ColumnNames = columnNames;
     
    311315
    312316      foreach (string cn in columnNames) {
    313         var tmpRuns = runs.Where(x => ((string)((dynamic)x.Parameters[parameterName]).Value.ToString()) == cn);
     317        var tmpRuns = runs.Where(x =>
     318        x.Parameters.ContainsKey(parameterName) &&
     319        (((string)((dynamic)x.Parameters[parameterName]).Value.ToString()) == cn));
    314320        runCols.Add(tmpRuns);
    315321      }
     
    331337
    332338    private bool VerifyDataLength(bool showMessage) {
    333       if (data == null || data.Length == 0)
     339      if (data == null || data.Length < 2)
    334340        return false;
    335341
     
    457463      double[][] newData = FilterDataForPairwiseTest(colIndex);
    458464
    459       var rowNames = new[] { "p-Value of Mann-Whitney U", "Adjusted p-Value of Mann-Whitney U", 
     465      var rowNames = new[] { "p-Value of Mann-Whitney U", "Adjusted p-Value of Mann-Whitney U",
    460466            "p-Value of T-Test", "Adjusted p-Value of T-Test", "Cohen's d", "Hedges' g" };
    461467
Note: See TracChangeset for help on using the changeset viewer.