Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/21 16:07:45 (2 years ago)
Author:
mkommend
Message:

#2521: Merged trunk changes into branch.

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/Feynman1.cs

    r17678 r18086  
    2828    public override string Name {
    2929      get {
    30         return string.Format("I.6.20a exp(-theta**2/2)/sqrt(2*pi) | {0} samples | {1}", trainingSamples,
     30        return string.Format("I.6.20a exp(-theta**2/2)/sqrt(2*pi) | {0}",
    3131          noiseRatio == null ? "no noise" : string.Format(System.Globalization.CultureInfo.InvariantCulture, "noise={0:g}",noiseRatio));
    3232      }
     
    3434
    3535    protected override string TargetVariable { get { return noiseRatio == null ? "f" : "f_noise"; } }
    36     protected override string[] VariableNames { get { return new[] {"theta", noiseRatio == null ? "f" : "f_noise"}; } }
     36
     37    protected override string[] VariableNames {
     38      get { return noiseRatio == null ? new[] {"theta", "f"} : new[] { "theta", "f", "f_noise" }; }
     39    }
     40
    3741    protected override string[] AllowedInputVariables { get { return new[] {"theta"}; } }
    3842
     
    6064      }
    6165
    62       if (noiseRatio != null) {
     66      /*if (noiseRatio != null) {
    6367        var f_noise     = new List<double>();
    64         var sigma_noise = (double) noiseRatio * f.StandardDeviationPop();
    65         f_noise.AddRange(f.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     68        var sigma_noise = (double) Math.Sqrt(noiseRatio.Value) * f.StandardDeviationPop();
     69        f_noise.AddRange(f.Select(md => md + NormalDistributedRandomPolar.NextDouble(rand, 0, sigma_noise)));
    6670        data.Remove(f);
    6771        data.Add(f_noise);
    68       }
     72      }*/
     73      var targetNoise = ValueGenerator.GenerateNoise(f, rand, noiseRatio);
     74      if (targetNoise != null) data.Add(targetNoise);
    6975
    7076      return data;
Note: See TracChangeset for help on using the changeset viewer.