Changeset 14351 for branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Timestamp:
- 10/23/16 09:44:29 (8 years ago)
- Location:
- branches/symbreg-factors-2650
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/symbreg-factors-2650
- Property svn:mergeinfo changed
/trunk/sources merged: 14332,14340-14350
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 14348
- Property svn:mergeinfo changed
-
branches/symbreg-factors-2650/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionSolutionVariableImpactsCalculator.cs
r14249 r14351 171 171 // new var has same empirical distribution but the relation to y is broken 172 172 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 } 174 182 break; 175 183 case ReplacementMethodEnum.Noise: … … 177 185 var stdDev = rows.Select(r => originalValues[r]).StandardDeviation(); 178 186 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 } 180 193 break; 181 194
Note: See TracChangeset
for help on using the changeset viewer.