Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/21/18 14:08:26 (7 years ago)
Author:
fholzing
Message:

#2871: Added textual status update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs

    r15798 r15799  
    9797      ReplacementMethodEnum replacementMethod = ReplacementMethodEnum.Median,
    9898      FactorReplacementMethodEnum factorReplacementMethod = FactorReplacementMethodEnum.Best,
    99       Func<double, bool> progressCallback = null) {
     99      Func<double, string, bool> progressCallback = null) {
    100100
    101101      var problemData = solution.ProblemData;
     
    135135      var allowedInputVariables = dataset.VariableNames.Where(v => inputvariables.Contains(v)).ToList();
    136136
    137       int curIdx = 1;
     137      int curIdx = 0;
    138138      int count = allowedInputVariables.Where(problemData.Dataset.VariableHasType<double>).Count();
    139139      // calculate impacts for double variables
     
    141141        //Report the current progress in percent. If the callback returns true, it means the execution shall be stopped
    142142        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; }
    144145        }
    145146        var newEstimates = EvaluateModelWithReplacedVariable(solution.Model, inputVariable, modifiableDataset, rows, replacementMethod);
Note: See TracChangeset for help on using the changeset viewer.