- Timestamp:
- 02/21/18 14:08:26 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.