Changeset 6775


Ignore:
Timestamp:
09/15/11 17:36:46 (8 years ago)
Author:
gkronber
Message:

#1635: fixed a crash when trying to calculate variable impacts for runs that did not collect statistics about variable frequency.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/RunCollectionVariableImpactView.cs

    r6766 r6775  
    104104                     select r;
    105105        if (comboBox.SelectedIndex == 0) {
    106           var selectedFolds = cvRuns.SelectMany(r => (RunCollection)r.Results[crossValidationFoldsResultName]);
     106          var selectedFolds = cvRuns
     107            .SelectMany(r => (RunCollection)r.Results[crossValidationFoldsResultName])
     108            .Where(r => r.Results.ContainsKey(variableImpactResultName));
    107109          matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray());
    108110        } else {
    109111          var selectedFolds = from r in cvRuns
    110112                              let foldCollection = (RunCollection)r.Results[crossValidationFoldsResultName]
    111                               select (IRun)foldCollection.ElementAt(comboBox.SelectedIndex - 1).Clone();
    112           matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray(), cvRuns.Select(r => r.Name).ToArray());
     113                              let run = foldCollection.ElementAt(comboBox.SelectedIndex - 1)
     114                              where run.Results.ContainsKey(variableImpactResultName)
     115                              select new { run, r.Name };
     116          matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.Select(x => x.run).ToArray(), selectedFolds.Select(x => x.Name).ToArray());
    113117        }
    114118      }
     
    135139            comboBox.SelectedIndex = 0;
    136140            comboBox.Enabled = true;
    137             var selectedFolds = cvRuns.SelectMany(r => (RunCollection)r.Results[crossValidationFoldsResultName]);
    138             matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray());
    139141          } else {
    140142            matrixView.Content = null;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r6740 r6775  
    230230        chart.Legends[series.Legend].ForeColor = Color.Black;
    231231        UpdateCursorInterval();
     232        chart.Refresh();
    232233      }
    233234    }
Note: See TracChangeset for help on using the changeset viewer.