Changeset 15799
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionVariableImpactsView.cs
r15797 r15799 154 154 try { 155 155 var impacts = await Task.Run(() => RegressionSolutionVariableImpactsCalculator.CalculateImpacts(Content, dataPartition, replMethod, factorReplMethod, 156 (i ) => {156 (i, s) => { 157 157 progress.ProgressValue = i; 158 progress.Status = s; 158 159 return cancellationToken.Token.IsCancellationRequested; 159 160 }), cancellationToken.Token); -
trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r15798 r15799 97 97 ReplacementMethodEnum replacementMethod = ReplacementMethodEnum.Median, 98 98 FactorReplacementMethodEnum factorReplacementMethod = FactorReplacementMethodEnum.Best, 99 Func<double, bool> progressCallback = null) {99 Func<double, string, bool> progressCallback = null) { 100 100 101 101 var problemData = solution.ProblemData; … … 135 135 var allowedInputVariables = dataset.VariableNames.Where(v => inputvariables.Contains(v)).ToList(); 136 136 137 int curIdx = 1;137 int curIdx = 0; 138 138 int count = allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>).Count(); 139 139 // calculate impacts for double variables … … 141 141 //Report the current progress in percent. If the callback returns true, it means the execution shall be stopped 142 142 if (progressCallback != null) { 143 if (progressCallback((double)curIdx++ / count)) { return null; } 143 curIdx++; 144 if (progressCallback((double)curIdx / count, $"Calculating impact for variable {inputVariable} ({curIdx} of {count})")) { return null; } 144 145 } 145 146 var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacementMethod);
Note: See TracChangeset
for help on using the changeset viewer.