- Timestamp:
- 10/22/16 11:19:45 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r13986 r14348 156 156 // new var has same empirical distribution but the relation to y is broken 157 157 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 } 159 167 break; 160 168 case ReplacementMethodEnum.Noise: … … 162 170 var stdDev = rows.Select(r => originalValues[r]).StandardDeviation(); 163 171 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 } 165 178 break; 166 179
Note: See TracChangeset
for help on using the changeset viewer.