Changeset 18086 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Friedman
- Timestamp:
- 11/19/21 16:07:45 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Friedman/FriedmanRandomFunction.cs
r17226 r18086 86 86 var y = GenerateRandomFunction(random, data); 87 87 88 var targetSigma = y.StandardDeviation();89 var noisePrng = new NormalDistributedRandom(random, 0, targetSigma * Math.Sqrt(noiseRatio / (1.0 - noiseRatio)));88 //var targetSigma = y.StandardDeviation(); 89 //var noisePrng = new NormalDistributedRandom(random, 0, targetSigma * Math.Sqrt(noiseRatio / (1.0 - noiseRatio))); 90 90 91 data.Add(y.Select(t => t + noisePrng.NextDouble()).ToList()); 91 //data.Add(y.Select(t => t + noisePrng.NextDouble()).ToList()); 92 93 data.Add(ValueGenerator.GenerateNoise(y, random, noiseRatio)); 92 94 93 95 return data; … … 121 123 // mu is generated from same distribution as x 122 124 double[] mu = Enumerable.Range(0, nl).Select(_ => random.NextDouble() * 2 - 1).ToArray(); 123 double[,] v = new double[nl, nl];124 125 var condNum = 4.0 / 0.01; // as given in the paper for max and min eigen values 125 126 … … 128 129 alglib.math.rndobject = new System.Random(random.Next()); 129 130 130 alglib. matgen.spdmatrixrndcond(nl, condNum, refv);131 alglib.spdmatrixrndcond(nl, condNum, out var v); 131 132 // restore 132 133 alglib.math.rndobject = curRand; … … 137 138 for (int i = 0; i < nRows; i++) { 138 139 for (int j = 0; j < nl; j++) z[j] = xs[j][i] - mu[j]; 139 alglib. ablas.rmatrixmv(nl, nl, v, 0, 0, 0, z, 0, ref y, 0);140 alglib.rmatrixmv(nl, nl, v, 0, 0, 0, z, 0, ref y, 0); 140 141 141 142 // dot prod
Note: See TracChangeset
for help on using the changeset viewer.