Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/22/16 11:19:45 (8 years ago)
Author:
gkronber
Message:

#2673: removed button for variable impacts calculation and implemented a separate SolutionView instead. Fixed a bug in Regression/RegressionSolutionVariableImpactsCalculator

File:
1 edited

Legend:

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

    r13986 r14348  
    156156          // new var has same empirical distribution but the relation to y is broken
    157157          rand = new FastRandom(31415);
    158           replacementValues = rows.Select(r => originalValues[r]).Shuffle(rand).ToList();
     158          // prepare a complete column for the dataset
     159          replacementValues = Enumerable.Repeat(double.NaN, dataset.Rows).ToList();
     160          // shuffle only the selected rows
     161          var shuffledValues = rows.Select(r => originalValues[r]).Shuffle(rand).ToList();
     162          int i = 0;
     163          // update column values
     164          foreach (var r in rows) {
     165            replacementValues[r] = shuffledValues[i++];
     166          }
    159167          break;
    160168        case ReplacementMethodEnum.Noise:
     
    162170          var stdDev = rows.Select(r => originalValues[r]).StandardDeviation();
    163171          rand = new FastRandom(31415);
    164           replacementValues = rows.Select(_ => NormalDistributedRandom.NextDouble(rand, avg, stdDev)).ToList();
     172          // prepare a complete column for the dataset
     173          replacementValues = Enumerable.Repeat(double.NaN, dataset.Rows).ToList();
     174          // update column values
     175          foreach (var r in rows) {
     176            replacementValues[r] = NormalDistributedRandom.NextDouble(rand, avg, stdDev);
     177          }
    165178          break;
    166179
Note: See TracChangeset for help on using the changeset viewer.