Changeset 17928 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs
- Timestamp:
- 04/06/21 13:13:32 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionVariableImpactsView.cs
r17180 r17928 25 25 using System.Threading; 26 26 using System.Threading.Tasks; 27 using System.Windows.Forms; 27 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Data; … … 86 87 } 87 88 } 88 private void ClassificationSolutionVariableImpactsView_VisibleChanged(object sender, EventArgs e) { 89 protected override void OnVisibleChanged(EventArgs e) { 90 base.OnVisibleChanged(e); 91 if (!this.Visible) { 92 cancellationToken.Cancel(); 93 } 94 } 95 96 protected override void OnClosed(FormClosedEventArgs e) { 97 base.OnClosed(e); 89 98 cancellationToken.Cancel(); 90 99 } … … 137 146 .ToList(); 138 147 139 List<Tuple<string, double>> impacts = null; 140 await Task.Run(() => { impacts = CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedClassValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress); }); 141 if (impacts == null) { return; } 148 var impacts = await Task.Run(() => CalculateVariableImpacts(originalVariableOrdering, Content.Model, problemData, Content.EstimatedClassValues, dataPartition, replMethod, factorReplMethod, cancellationToken.Token, progress)); 142 149 143 150 rawVariableImpacts.AddRange(impacts); 144 151 UpdateOrdering(); 152 } catch (OperationCanceledException) { 145 153 } finally { 146 154 Progress.Hide(this); … … 169 177 var clonedModel = (IClassificationModel)model.Clone(); 170 178 foreach (var variableName in originalVariableOrdering) { 171 if (cancellationToken.Token.IsCancellationRequested) { return null; }179 token.ThrowIfCancellationRequested(); 172 180 progress.ProgressValue = (double)++i / count; 173 181 progress.Message = string.Format("Calculating impact for variable {0} ({1} of {2})", variableName, i, count);
Note: See TracChangeset
for help on using the changeset viewer.