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/Feynman29.cs

    r17678 r18086  
    2828    public override string Name {
    2929      get {
    30         return string.Format("I.29.16 sqrt(x1**2+x2**2 - 2*x1*x2*cos(theta1 - theta2)) | {0} samples | {1}",
    31           trainingSamples, noiseRatio == null ? "no noise" : string.Format(System.Globalization.CultureInfo.InvariantCulture, "noise={0:g}",noiseRatio));
     30        return string.Format("I.29.16 sqrt(x1**2+x2**2 - 2*x1*x2*cos(theta1 - theta2)) | {0}",
     31          noiseRatio == null ? "no noise" : string.Format(System.Globalization.CultureInfo.InvariantCulture, "noise={0:g}",noiseRatio));
    3232      }
    3333    }
     
    3636
    3737    protected override string[] VariableNames {
    38       get { return new[] {"x1", "x2", "theta1", "theta2", noiseRatio == null ? "x" : "x_noise"}; }
     38      get { return noiseRatio == null ? new[] { "x1", "x2", "theta1", "theta2", "x" } : new[] { "x1", "x2", "theta1", "theta2", "x", "x_noise" }; }
    3939    }
    4040
     
    7171      }
    7272
    73       if (noiseRatio != null) {
    74         var x_noise     = new List<double>();
    75         var sigma_noise = (double) noiseRatio * x.StandardDeviationPop();
    76         x_noise.AddRange(x.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
    77         data.Remove(x);
    78         data.Add(x_noise);
    79       }
     73      var targetNoise = ValueGenerator.GenerateNoise(x, rand, noiseRatio);
     74      if (targetNoise != null) data.Add(targetNoise);
    8075
    8176      return data;
Note: See TracChangeset for help on using the changeset viewer.