Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6766


Ignore:
Timestamp:
09/15/11 09:52:33 (13 years ago)
Author:
gkronber
Message:

#1635 added possibility to calculate impacts over all folds for cross validation runs.

File:
1 edited

Legend:

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

    r6709 r6766  
    103103                     where r.Parameters.ContainsKey(numberOfFoldsParameterName)
    104104                     select r;
    105         var selectedFolds = from r in cvRuns
    106                             let foldCollection = (RunCollection)r.Results[crossValidationFoldsResultName]
    107                             select (IRun)foldCollection.ElementAt((int)comboBox.SelectedItem).Clone();
    108         matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray(), cvRuns.Select(r => r.Name).ToArray());
     105        if (comboBox.SelectedIndex == 0) {
     106          var selectedFolds = cvRuns.SelectMany(r => (RunCollection)r.Results[crossValidationFoldsResultName]);
     107          matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray());
     108        } else {
     109          var selectedFolds = from r in cvRuns
     110                              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        }
    109114      }
    110115    }
     
    124129          if (cvRuns.All(r => ((IntValue)r.Parameters[numberOfFoldsParameterName]).Value == nFolds)) {
    125130            // populate combobox
     131            comboBox.Items.Add("Overall");
    126132            for (int foldIndex = 0; foldIndex < nFolds; foldIndex++) {
    127               comboBox.Items.Add(foldIndex);
     133              comboBox.Items.Add("Fold " + foldIndex);
    128134            }
     135            comboBox.SelectedIndex = 0;
    129136            comboBox.Enabled = true;
    130             var selectedFolds = from r in cvRuns
    131                                 let foldCollection = (RunCollection)r.Results[crossValidationFoldsResultName]
    132                                 select foldCollection.First();
    133             matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray(), cvRuns.Select(f => f.Name).ToArray());
     137            var selectedFolds = cvRuns.SelectMany(r => (RunCollection)r.Results[crossValidationFoldsResultName]);
     138            matrixView.Content = CalculateVariableImpactMatrix(selectedFolds.ToArray());
    134139          } else {
    135140            matrixView.Content = null;
Note: See TracChangeset for help on using the changeset viewer.