Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/23/16 09:44:29 (8 years ago)
Author:
gkronber
Message:

#2650: merged r14332:14350 from trunk to branch

Location:
branches/symbreg-factors-2650
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis

  • branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs

    r14249 r14351  
    171171          // new var has same empirical distribution but the relation to y is broken
    172172          rand = new FastRandom(31415);
    173           replacementValues = rows.Select(r => originalValues[r]).Shuffle(rand).ToList();
     173          // prepare a complete column for the dataset
     174          replacementValues = Enumerable.Repeat(double.NaN, dataset.Rows).ToList();
     175          // shuffle only the selected rows
     176          var shuffledValues = rows.Select(r => originalValues[r]).Shuffle(rand).ToList();
     177          int i = 0;
     178          // update column values
     179          foreach (var r in rows) {
     180            replacementValues[r] = shuffledValues[i++];
     181          }
    174182          break;
    175183        case ReplacementMethodEnum.Noise:
     
    177185          var stdDev = rows.Select(r => originalValues[r]).StandardDeviation();
    178186          rand = new FastRandom(31415);
    179           replacementValues = rows.Select(_ => NormalDistributedRandom.NextDouble(rand, avg, stdDev)).ToList();
     187          // prepare a complete column for the dataset
     188          replacementValues = Enumerable.Repeat(double.NaN, dataset.Rows).ToList();
     189          // update column values
     190          foreach (var r in rows) {
     191            replacementValues[r] = NormalDistributedRandom.NextDouble(rand, avg, stdDev);
     192          }
    180193          break;
    181194
Note: See TracChangeset for help on using the changeset viewer.