Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/07/20 10:47:27 (4 years ago)
Author:
chaider
Message:

#3075 Added noise instances for feynman bonus instances

Location:
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus1.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus1() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus1() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus1(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus1(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus1(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman Rutherford scattering (Z_1*Z_2*alpha*hbar*c/(4*E_n*sin(theta/2)**2))**2 | {0} samples",
    29           trainingSamples);
     31          "Feynman Rutherford scattering (Z_1*Z_2*alpha*hbar*c/(4*E_n*sin(theta/2)**2))**2 | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "A"; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "A" : "A_noise"; } }
    3437
    3538    protected override string[] VariableNames {
    36       get { return new[] {"Z_1", "Z_2", "alpha", "hbar", "c", "E_n", "theta", "A"}; }
     39      get { return new[] {"Z_1", "Z_2", "alpha", "hbar", "c", "E_n", "theta", noiseRatio == null ? "A" : "A_noise"}; }
    3740    }
    3841
     
    7275
    7376      for (var i = 0; i < Z_1.Count; i++) {
    74         var res = Math.Pow(Z_1[i] * Z_2[i] * alpha[i] * hbar[i] * c[i] / Math.Pow(4 * E_n[i] * Math.Sin(theta[i] / 2), 2), 2);
     77        var res = Math.Pow(
     78          Z_1[i] * Z_2[i] * alpha[i] * hbar[i] * c[i] / Math.Pow(4 * E_n[i] * Math.Sin(theta[i] / 2), 2), 2);
    7579        A.Add(res);
     80      }
     81
     82      if (noiseRatio != null) {
     83        var A_noise     = new List<double>();
     84        var sigma_noise = (double) noiseRatio * A.StandardDeviationPop();
     85        A_noise.AddRange(A.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     86        data.Remove(A);
     87        data.Add(A_noise);
    7688      }
    7789
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus10.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus10() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus10() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus10(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus10(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus10(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman Relativistic aberation arccos((cos(theta2)-v/c)/(1-v/c*cos(theta2))) | {0} samples",
    29           trainingSamples);
     31          "Feynman Relativistic aberation arccos((cos(theta2)-v/c)/(1-v/c*cos(theta2))) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "theta1"; } }
    34     protected override string[] VariableNames { get { return new[] {"c", "v", "theta2", "theta1"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "theta1" : "theta1_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"c", "v", "theta2", noiseRatio == null ? "theta1" : "theta1_noise"}; }
     40    }
     41
    3542    protected override string[] AllowedInputVariables { get { return new[] {"c", "v", "theta2"}; } }
    3643
     
    6269      }
    6370
     71      if (noiseRatio != null) {
     72        var theta1_noise = new List<double>();
     73        var sigma_noise  = (double) noiseRatio * theta1.StandardDeviationPop();
     74        theta1_noise.AddRange(theta1.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     75        data.Remove(theta1);
     76        data.Add(theta1_noise);
     77      }
     78
    6479      return data;
    6580    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus11.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus11() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus11() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus11(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus11(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus11(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman N-slit diffraction I_0*(sin(alpha/2)*sin(n*delta/2)/(alpha/2*sin(delta/2)))**2 | {0} samples",
    29           trainingSamples);
     31          "Feynman N-slit diffraction I_0*(sin(alpha/2)*sin(n*delta/2)/(alpha/2*sin(delta/2)))**2 | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "I"; } }
    34     protected override string[] VariableNames { get { return new[] {"I_0", "alpha", "delta", "n", "I"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "I" : "I_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"I_0", "alpha", "delta", "n", noiseRatio == null ? "I" : "I_noise"}; }
     40    }
     41
    3542    protected override string[] AllowedInputVariables { get { return new[] {"I_0", "alpha", "delta", "n"}; } }
    3643
     
    6168      for (var i = 0; i < I_0.Count; i++) {
    6269        var res = I_0[i] * Math.Pow(
    63                     Math.Sin(alpha[i] / 2) * Math.Sin(n[i] * delta[i] / 2) / (alpha[i] / 2 * Math.Sin(delta[i] / 2)), 2);
     70                    Math.Sin(alpha[i] / 2) * Math.Sin(n[i] * delta[i] / 2) / (alpha[i] / 2 * Math.Sin(delta[i] / 2)),
     71                    2);
    6472        I.Add(res);
     73      }
     74
     75      if (noiseRatio != null) {
     76        var I_noise     = new List<double>();
     77        var sigma_noise = (double) noiseRatio * I.StandardDeviationPop();
     78        I_noise.AddRange(I.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     79        data.Remove(I);
     80        data.Add(I_noise);
    6581      }
    6682
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus12.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus12() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus12() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus12(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus12(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus12(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman 2.11 Jackson q/(4*pi*epsilon*y**2)*(4*pi*epsilon*Volt*d-q*d*y**3/(y**2-d**2)**2) | {0} samples",
    29           trainingSamples);
     31          "Feynman 2.11 Jackson q/(4*pi*epsilon*y**2)*(4*pi*epsilon*Volt*d-q*d*y**3/(y**2-d**2)**2) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "F"; } }
    34     protected override string[] VariableNames { get { return new[] {"q", "y", "Volt", "d", "epsilon", "F"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "F" : "F_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"q", "y", "Volt", "d", "epsilon", noiseRatio == null ? "F" : "F_noise"}; }
     40    }
     41
    3542    protected override string[] AllowedInputVariables { get { return new[] {"q", "y", "Volt", "d", "epsilon"}; } }
    3643
     
    6875      }
    6976
     77      if (noiseRatio != null) {
     78        var F_noise     = new List<double>();
     79        var sigma_noise = (double) noiseRatio * F.StandardDeviationPop();
     80        F_noise.AddRange(F.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     81        data.Remove(F);
     82        data.Add(F_noise);
     83      }
     84
    7085      return data;
    7186    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus13.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus13() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus13() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus13(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus13(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus13(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 3.45 Jackson 1/(4*pi*epsilon)*q/sqrt(r**2+d**2-2*r*d*cos(alpha)) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 3.45 Jackson 1/(4*pi*epsilon)*q/sqrt(r**2+d**2-2*r*d*cos(alpha)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "Volt"; } }
    33     protected override string[] VariableNames { get { return new[] {"q", "r", "d", "alpha", "epsilon", "Volt"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "Volt" : "Volt_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"q", "r", "d", "alpha", "epsilon", noiseRatio == null ? "Volt" : "Volt_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"q", "r", "d", "alpha", "epsilon"}; } }
    3543
     
    6169
    6270      for (var i = 0; i < q.Count; i++) {
    63         var res = 1.0 / (4 * Math.PI * epsilon[i]) * q[i] / Math.Sqrt(Math.Pow(r[i], 2) + Math.Pow(d[i], 2) - 2 * r[i] * d[i] * Math.Cos(alpha[i]));
     71        var res = 1.0 / (4 * Math.PI * epsilon[i]) * q[i] /
     72                  Math.Sqrt(Math.Pow(r[i], 2) + Math.Pow(d[i], 2) - 2 * r[i] * d[i] * Math.Cos(alpha[i]));
    6473        Volt.Add(res);
     74      }
     75
     76      if (noiseRatio != null) {
     77        var Volt_noise  = new List<double>();
     78        var sigma_noise = (double) noiseRatio * Volt.StandardDeviationPop();
     79        Volt_noise.AddRange(Volt.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     80        data.Remove(Volt);
     81        data.Add(Volt_noise);
    6582      }
    6683
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus14.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus14() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus14() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus14(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus14(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus14(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 4.60' Jackson Ef*cos(theta)*(-r+d**3/r**2*(alpha-1)/(alpha+2)) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 4.60' Jackson Ef*cos(theta)*(-r+d**3/r**2*(alpha-1)/(alpha+2)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "Volt"; } }
    33     protected override string[] VariableNames { get { return new[] {"Ef", "theta", "r", "d", "alpha", "Volt"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "Volt" : "Volt_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"Ef", "theta", "r", "d", "alpha", noiseRatio == null ? "Volt" : "Volt_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"Ef", "theta", "r", "d", "alpha"}; } }
    3543
     
    6674      }
    6775
     76      if (noiseRatio != null) {
     77        var Volt_noise  = new List<double>();
     78        var sigma_noise = (double) noiseRatio * Volt.StandardDeviationPop();
     79        Volt_noise.AddRange(Volt.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     80        data.Remove(Volt);
     81        data.Add(Volt_noise);
     82      }
     83
    6884      return data;
    6985    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus15.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus15() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus15() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus15(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus15(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus15(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 11.38 Jackson sqrt(1-v**2/c**2)*omega/(1+v/c*cos(theta)) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 11.38 Jackson sqrt(1-v**2/c**2)*omega/(1+v/c*cos(theta)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "omega_0"; } }
    33     protected override string[] VariableNames { get { return new[] {"c", "v", "omega", "theta", "omega_0"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "omega_0" : "omega_0_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"c", "v", "omega", "theta", noiseRatio == null ? "omega_0" : "omega_0_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"c", "v", "omega", "theta"}; } }
    3543
     
    6472      }
    6573
     74      if (noiseRatio != null) {
     75        var omega_0_noise = new List<double>();
     76        var sigma_noise   = (double) noiseRatio * omega_0.StandardDeviationPop();
     77        omega_0_noise.AddRange(omega_0.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     78        data.Remove(omega_0);
     79        data.Add(omega_0_noise);
     80      }
     81
    6682      return data;
    6783    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus16.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus16() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus16() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus16(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus16(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus16(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 8.56 Goldstein sqrt((p-q*A_vec)**2*c**2+m**2*c**4)+q*Volt | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 8.56 Goldstein sqrt((p-q*A_vec)**2*c**2+m**2*c**4)+q*Volt | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "E_n"; } }
    33     protected override string[] VariableNames { get { return new[] {"m", "c", "p", "q", "A_vec", "Volt", "E_n"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "E_n" : "E_n_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"m", "c", "p", "q", "A_vec", "Volt", noiseRatio == null ? "E_n" : "E_n_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"m", "c", "p", "q", "A_vec", "Volt"}; } }
    3543
     
    6371
    6472      for (var i = 0; i < m.Count; i++) {
    65         var res = Math.Sqrt(Math.Pow((p[i] - q[i] * A_vec[i]), 2) * Math.Pow(c[i], 2) +
     73        var res = Math.Sqrt(Math.Pow(p[i] - q[i] * A_vec[i], 2) * Math.Pow(c[i], 2) +
    6674                            Math.Pow(m[i], 2) * Math.Pow(c[i], 4)) + q[i] * Volt[i];
    6775        E_n.Add(res);
     76      }
     77
     78      if (noiseRatio != null) {
     79        var E_n_noise   = new List<double>();
     80        var sigma_noise = (double) noiseRatio * E_n.StandardDeviationPop();
     81        E_n_noise.AddRange(E_n.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     82        data.Remove(E_n);
     83        data.Add(E_n_noise);
    6884      }
    6985
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus17.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus17() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus17() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus17(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus17(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus17(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 12.80' Goldstein 1/(2*m)*(p**2+m**2*omega**2*x**2*(1+alpha*x/y)) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 12.80' Goldstein 1/(2*m)*(p**2+m**2*omega**2*x**2*(1+alpha*x/y)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "E_n"; } }
    33     protected override string[] VariableNames { get { return new[] {"m", "omega", "p", "y", "x", "alpha", "E_n"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "E_n" : "E_n_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"m", "omega", "p", "y", "x", "alpha", noiseRatio == null ? "E_n" : "E_n_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"m", "omega", "p", "y", "x", "alpha"}; } }
    3543
     
    6977      }
    7078
     79      if (noiseRatio != null) {
     80        var E_n_noise   = new List<double>();
     81        var sigma_noise = (double) noiseRatio * E_n.StandardDeviationPop();
     82        E_n_noise.AddRange(E_n.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     83        data.Remove(E_n);
     84        data.Add(E_n_noise);
     85      }
     86
    7187      return data;
    7288    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus18.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus18() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus18() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus18(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus18(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus18(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 15.2.1 Weinberg 3/(8*pi*G)*(c**2*k_f/r**2+H_G**2) | {0} samples",
    28           trainingSamples);
     30        return string.Format("Feynman 15.2.1 Weinberg 3/(8*pi*G)*(c**2*k_f/r**2+H_G**2) | {0} samples | noise ({1})",
     31          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2932      }
    3033    }
    3134
    32     protected override string TargetVariable { get { return "rho_0"; } }
    33     protected override string[] VariableNames { get { return new[] {"G", "k_f", "r", "H_G", "c", "rho_0"}; } }
     35    protected override string TargetVariable { get { return noiseRatio == null ? "rho_0" : "rho_0_noise"; } }
     36
     37    protected override string[] VariableNames {
     38      get { return new[] {"G", "k_f", "r", "H_G", "c", noiseRatio == null ? "rho_0" : "rho_0_noise"}; }
     39    }
     40
    3441    protected override string[] AllowedInputVariables { get { return new[] {"G", "k_f", "r", "H_G", "c"}; } }
    3542
     
    6572      }
    6673
     74      if (noiseRatio != null) {
     75        var rho_0_noise = new List<double>();
     76        var sigma_noise = (double) noiseRatio * rho_0.StandardDeviationPop();
     77        rho_0_noise.AddRange(rho_0.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     78        data.Remove(rho_0);
     79        data.Add(rho_0_noise);
     80      }
     81
    6782      return data;
    6883    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus19.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus19() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus19() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus19(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus19(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus19(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman 15.2.2 Weinberg -1/(8*pi*G)*(c**4*k_f/r**2+H_G**2*c**2*(1-2*alpha)) | {0} samples", trainingSamples);
     31          "Feynman 15.2.2 Weinberg -1/(8*pi*G)*(c**4*k_f/r**2+H_G**2*c**2*(1-2*alpha)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "pr"; } }
    33     protected override string[] VariableNames { get { return new[] {"G", "k_f", "r", "H_G", "alpha", "c", "pr"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "pr" : "pr_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"G", "k_f", "r", "H_G", "alpha", "c", noiseRatio == null ? "pr" : "pr_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"G", "k_f", "r", "H_G", "alpha", "c"}; } }
    3543
     
    6876      }
    6977
     78      if (noiseRatio != null) {
     79        var pr_noise    = new List<double>();
     80        var sigma_noise = (double) noiseRatio * pr.StandardDeviationPop();
     81        pr_noise.AddRange(pr.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     82        data.Remove(pr);
     83        data.Add(pr_noise);
     84      }
     85
    7086      return data;
    7187    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus2.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus2() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus2() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus2(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus2(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus2(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman 3.55 Goldstein m*k_G/L**2*(1+sqrt(1+2*E_n*L**2/(m*k_G**2))*cos(theta1-theta2)) | {0} samples",
    29           trainingSamples);
     31          "Feynman 3.55 Goldstein m*k_G/L**2*(1+sqrt(1+2*E_n*L**2/(m*k_G**2))*cos(theta1-theta2)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "k"; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "k" : "k_noise"; } }
    3437
    3538    protected override string[] VariableNames {
    36       get { return new[] {"m", "k_G", "L", "E_n", "theta1", "theta2", "k"}; }
     39      get { return new[] {"m", "k_G", "L", "E_n", "theta1", "theta2", noiseRatio == null ? "k" : "k_noise"}; }
    3740    }
    3841
     
    7679      }
    7780
     81      if (noiseRatio != null) {
     82        var k_noise     = new List<double>();
     83        var sigma_noise = (double) noiseRatio * k.StandardDeviationPop();
     84        k_noise.AddRange(k.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     85        data.Remove(k);
     86        data.Add(k_noise);
     87      }
     88
    7889      return data;
    7990    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus20.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus20() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus20() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus20(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus20(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus20(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman Klein-Nishina (13.132 Schwarz) 1/(4*pi)*alpha**2*h**2/(m**2*c**2)*(omega_0/omega)**2*(omega_0/omega+omega/omega_0-sin(beta)**2) | {0} samples",
    29           trainingSamples);
     31          "Feynman Klein-Nishina (13.132 Schwarz) 1/(4*pi)*alpha**2*h**2/(m**2*c**2)*(omega_0/omega)**2*(omega_0/omega+omega/omega_0-sin(beta)**2) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "A"; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "A" : "A_noise"; } }
    3437
    3538    protected override string[] VariableNames {
    36       get { return new[] {"omega", "omega_0", "alpha", "h", "m", "c", "beta", "A"}; }
     39      get { return new[] {"omega", "omega_0", "alpha", "h", "m", "c", "beta", noiseRatio == null ? "A" : "A_noise"}; }
    3740    }
    3841
     
    7376      for (var i = 0; i < omega.Count; i++) {
    7477        var res = 1.0 / (4 * Math.PI) * Math.Pow(alpha[i], 2) * Math.Pow(h[i], 2) /
    75                   (Math.Pow(m[i], 2) * Math.Pow(c[i], 2)) * Math.Pow(
    76                     (omega_0[i] / omega[i]), 2) * (omega_0[i] / omega[i] + omega[i] / omega_0[i] - Math.Pow(Math.Sin(beta[i]), 2));
     78                  (Math.Pow(m[i], 2) * Math.Pow(c[i], 2)) * Math.Pow(omega_0[i] / omega[i], 2) *
     79                  (omega_0[i] / omega[i] + omega[i] / omega_0[i] - Math.Pow(Math.Sin(beta[i]), 2));
    7780        A.Add(res);
     81      }
     82
     83      if (noiseRatio != null) {
     84        var A_noise     = new List<double>();
     85        var sigma_noise = (double) noiseRatio * A.StandardDeviationPop();
     86        A_noise.AddRange(A.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     87        data.Remove(A);
     88        data.Add(A_noise);
    7889      }
    7990
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus3.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus3() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus3() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus3(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus3(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus3(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 3.64 Goldstein d*(1-alpha**2)/(1+alpha*cos(theta1-theta2)) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 3.64 Goldstein d*(1-alpha**2)/(1+alpha*cos(theta1-theta2)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "r"; } }
    33     protected override string[] VariableNames { get { return new[] {"d", "alpha", "theta1", "theta2", "r"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "r" : "r_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"d", "alpha", "theta1", "theta2", noiseRatio == null ? "r" : "r_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"d", "alpha", "theta1", "theta2"}; } }
    3543
     
    6371      }
    6472
     73      if (noiseRatio != null) {
     74        var r_noise     = new List<double>();
     75        var sigma_noise = (double) noiseRatio * r.StandardDeviationPop();
     76        r_noise.AddRange(r.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     77        data.Remove(r);
     78        data.Add(r_noise);
     79      }
     80
    6581      return data;
    6682    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus4.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus4() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus4() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus4(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus4(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus4(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 3.16 Goldstein sqrt(2/m*(E_n-U-L**2/(2*m*r**2))) | {0} samples", trainingSamples);
     30        return string.Format("Feynman 3.16 Goldstein sqrt(2/m*(E_n-U-L**2/(2*m*r**2))) | {0} samples | noise ({1})",
     31          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2832      }
    2933    }
    3034
    31     protected override string TargetVariable { get { return "v"; } }
    32     protected override string[] VariableNames { get { return new[] {"m", "E_n", "U", "L", "r", "v"}; } }
     35    protected override string TargetVariable { get { return noiseRatio == null ? "v" : "v_noise"; } }
     36
     37    protected override string[] VariableNames {
     38      get { return new[] {"m", "E_n", "U", "L", "r", noiseRatio == null ? "v" : "v_noise"}; }
     39    }
     40
    3341    protected override string[] AllowedInputVariables { get { return new[] {"m", "E_n", "U", "L", "r"}; } }
    3442
     
    6472      }
    6573
     74      if (noiseRatio != null) {
     75        var v_noise     = new List<double>();
     76        var sigma_noise = (double) noiseRatio * v.StandardDeviationPop();
     77        v_noise.AddRange(v.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     78        data.Remove(v);
     79        data.Add(v_noise);
     80      }
     81
    6682      return data;
    6783    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus5.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus5() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus5() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus5(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus5(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus5(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 3.74 Goldstein 2*pi*d**(3/2)/sqrt(G*(m1+m2)) | {0} samples", trainingSamples);
     30        return string.Format("Feynman 3.74 Goldstein 2*pi*d**(3/2)/sqrt(G*(m1+m2)) | {0} samples | noise ({1})",
     31          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2832      }
    2933    }
    3034
    31     protected override string TargetVariable { get { return "t"; } }
    32     protected override string[] VariableNames { get { return new[] {"d", "G", "m1", "m2", "t"}; } }
     35    protected override string TargetVariable { get { return noiseRatio == null ? "t" : "t_noise"; } }
     36
     37    protected override string[] VariableNames {
     38      get { return new[] {"d", "G", "m1", "m2", noiseRatio == null ? "t" : "t_noise"}; }
     39    }
     40
    3341    protected override string[] AllowedInputVariables { get { return new[] {"d", "G", "m1", "m2"}; } }
    3442
     
    5866
    5967      for (var i = 0; i < d.Count; i++) {
    60         var res = 2 * Math.PI * Math.Pow(d[i], (3.0 / 2)) / Math.Sqrt(G[i] * (m1[i] + m2[i]));
     68        var res = 2 * Math.PI * Math.Pow(d[i], 3.0 / 2) / Math.Sqrt(G[i] * (m1[i] + m2[i]));
    6169        t.Add(res);
     70      }
     71
     72      if (noiseRatio != null) {
     73        var t_noise     = new List<double>();
     74        var sigma_noise = (double) noiseRatio * t.StandardDeviationPop();
     75        t_noise.AddRange(t.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     76        data.Remove(t);
     77        data.Add(t_noise);
    6278      }
    6379
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus6.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus6() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus6() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus6(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus6(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus6(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman 3.99 Goldstein sqrt(1+2*epsilon**2*E_n*L**2/(m*(Z_1*Z_2*q**2)**2)) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman 3.99 Goldstein sqrt(1+2*epsilon**2*E_n*L**2/(m*(Z_1*Z_2*q**2)**2)) | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "alpha"; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "alpha" : "alpha_noise"; } }
    3337
    3438    protected override string[] VariableNames {
    35       get { return new[] {"epsilon", "L", "m", "Z_1", "Z_2", "q", "E_n", "alpha"}; }
     39      get {
     40        return new[] {"epsilon", "L", "m", "Z_1", "Z_2", "q", "E_n", noiseRatio == null ? "alpha" : "alpha_noise"};
     41      }
    3642    }
    3743
     
    7278      for (var i = 0; i < epsilon.Count; i++) {
    7379        var res = Math.Sqrt(1 + 2 * Math.Pow(epsilon[i], 2) * E_n[i] * Math.Pow(L[i], 2) /
    74                             (m[i] * Math.Pow((Z_1[i] * Z_2[i] * Math.Pow(q[i], 2)), 2)));
     80                            (m[i] * Math.Pow(Z_1[i] * Z_2[i] * Math.Pow(q[i], 2), 2)));
    7581        alpha.Add(res);
     82      }
     83
     84      if (noiseRatio != null) {
     85        var alpha_noise = new List<double>();
     86        var sigma_noise = (double) noiseRatio * alpha.StandardDeviationPop();
     87        alpha_noise.AddRange(alpha.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     88        data.Remove(alpha);
     89        data.Add(alpha_noise);
    7690      }
    7791
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus7.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus7() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus7() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus7(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus7(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus7(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman Friedman Equation sqrt(8*pi*G*rho/3-alpha*c**2/d**2) | {0} samples",
    28           trainingSamples);
     30        return string.Format("Feynman Friedman Equation sqrt(8*pi*G*rho/3-alpha*c**2/d**2) | {0} samples | noise ({1})",
     31          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2932      }
    3033    }
    3134
    32     protected override string TargetVariable { get { return "H_G"; } }
    33     protected override string[] VariableNames { get { return new[] {"G", "rho", "alpha", "c", "d", "H_G"}; } }
     35    protected override string TargetVariable { get { return noiseRatio == null ? "H_G" : "H_G_noise"; } }
     36
     37    protected override string[] VariableNames {
     38      get { return new[] {"G", "rho", "alpha", "c", "d", noiseRatio == null ? "H_G" : "H_G_noise"}; }
     39    }
     40
    3441    protected override string[] AllowedInputVariables { get { return new[] {"G", "rho", "alpha", "c", "d"}; } }
    3542
     
    6572      }
    6673
     74      if (noiseRatio != null) {
     75        var H_G_noise   = new List<double>();
     76        var sigma_noise = (double) noiseRatio * H_G.StandardDeviationPop();
     77        H_G_noise.AddRange(H_G.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     78        data.Remove(H_G);
     79        data.Add(H_G_noise);
     80      }
     81
    6782      return data;
    6883    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus8.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus8() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus8() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus8(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus8(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus8(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
    2528    public override string Name {
    2629      get {
    27         return string.Format("Feynman Compton Scattering E_n/(1+E_n/(m*c**2)*(1-cos(theta))) | {0} samples",
    28           trainingSamples);
     30        return string.Format(
     31          "Feynman Compton Scattering E_n/(1+E_n/(m*c**2)*(1-cos(theta))) | {0} samples | noise ({1})", trainingSamples,
     32          noiseRatio == null ? "no noise" : noiseRatio.ToString());
    2933      }
    3034    }
    3135
    32     protected override string TargetVariable { get { return "K"; } }
    33     protected override string[] VariableNames { get { return new[] {"E_n", "m", "c", "theta", "K"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "K" : "K_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"E_n", "m", "c", "theta", noiseRatio == null ? "K" : "K_noise"}; }
     40    }
     41
    3442    protected override string[] AllowedInputVariables { get { return new[] {"E_n", "m", "c", "theta"}; } }
    3543
     
    6371      }
    6472
     73      if (noiseRatio != null) {
     74        var K_noise     = new List<double>();
     75        var sigma_noise = (double) noiseRatio * K.StandardDeviationPop();
     76        K_noise.AddRange(K.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     77        data.Remove(K);
     78        data.Add(K_noise);
     79      }
     80
    6581      return data;
    6682    }
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus9.cs

    r17643 r17649  
    22using System.Collections.Generic;
    33using System.Linq;
     4using HeuristicLab.Common;
    45using HeuristicLab.Random;
    56
     
    910    private readonly int trainingSamples;
    1011
    11     public FeynmanBonus9() : this((int) DateTime.Now.Ticks, 10000, 10000) { }
     12    public FeynmanBonus9() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { }
    1213
    1314    public FeynmanBonus9(int seed) {
     
    1516      trainingSamples = 10000;
    1617      testSamples     = 10000;
     18      noiseRatio      = null;
    1719    }
    1820
    19     public FeynmanBonus9(int seed, int trainingSamples, int testSamples) {
     21    public FeynmanBonus9(int seed, int trainingSamples, int testSamples, double? noiseRatio) {
    2022      Seed                 = seed;
    2123      this.trainingSamples = trainingSamples;
    2224      this.testSamples     = testSamples;
     25      this.noiseRatio      = noiseRatio;
    2326    }
    2427
     
    2629      get {
    2730        return string.Format(
    28           "Feynman Gravitational wave ratiated power -32/5*G**4/c**5*(m1*m2)**2*(m1+m2)/r**5 | {0} samples",
    29           trainingSamples);
     31          "Feynman Gravitational wave ratiated power -32/5*G**4/c**5*(m1*m2)**2*(m1+m2)/r**5 | {0} samples | noise ({1})",
     32          trainingSamples, noiseRatio == null ? "no noise" : noiseRatio.ToString());
    3033      }
    3134    }
    3235
    33     protected override string TargetVariable { get { return "Pwr"; } }
    34     protected override string[] VariableNames { get { return new[] {"G", "c", "m1", "m2", "r", "Pwr"}; } }
     36    protected override string TargetVariable { get { return noiseRatio == null ? "Pwr" : "Pwr_noise"; } }
     37
     38    protected override string[] VariableNames {
     39      get { return new[] {"G", "c", "m1", "m2", "r", noiseRatio == null ? "Pwr" : "Pwr_noise"}; }
     40    }
     41
    3542    protected override string[] AllowedInputVariables { get { return new[] {"G", "c", "m1", "m2", "r"}; } }
    3643
     
    6269
    6370      for (var i = 0; i < G.Count; i++) {
    64         var res = -32.0 / 5 * Math.Pow(G[i], 4) / Math.Pow(c[i], 5) * Math.Pow((m1[i] * m2[i]), 2) * (m1[i] + m2[i]) /
     71        var res = -32.0 / 5 * Math.Pow(G[i], 4) / Math.Pow(c[i], 5) * Math.Pow(m1[i] * m2[i], 2) * (m1[i] + m2[i]) /
    6572                  Math.Pow(r[i], 5);
    6673        Pwr.Add(res);
     74      }
     75
     76      if (noiseRatio != null) {
     77        var Pwr_noise   = new List<double>();
     78        var sigma_noise = (double) noiseRatio * Pwr.StandardDeviationPop();
     79        Pwr_noise.AddRange(Pwr.Select(md => md + NormalDistributedRandom.NextDouble(rand, 0, sigma_noise)));
     80        data.Remove(Pwr);
     81        data.Add(Pwr_noise);
    6782      }
    6883
  • branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanInstanceProvider.cs

    r17647 r17649  
    140140          descriptorList.Add(new Feynman99(rand.Next(), s, s, n));
    141141          descriptorList.Add(new Feynman100(rand.Next(), s, s, n));
     142          descriptorList.Add(new FeynmanBonus1(rand.Next(), s, s, n));
     143          descriptorList.Add(new FeynmanBonus2(rand.Next(), s, s, n));
     144          descriptorList.Add(new FeynmanBonus3(rand.Next(), s, s, n));
     145          descriptorList.Add(new FeynmanBonus4(rand.Next(), s, s, n));
     146          descriptorList.Add(new FeynmanBonus5(rand.Next(), s, s, n));
     147          descriptorList.Add(new FeynmanBonus6(rand.Next(), s, s, n));
     148          descriptorList.Add(new FeynmanBonus7(rand.Next(), s, s, n));
     149          descriptorList.Add(new FeynmanBonus8(rand.Next(), s, s, n));
     150          descriptorList.Add(new FeynmanBonus9(rand.Next(), s, s, n));
     151          descriptorList.Add(new FeynmanBonus10(rand.Next(), s, s, n));
     152          descriptorList.Add(new FeynmanBonus11(rand.Next(), s, s, n));
     153          descriptorList.Add(new FeynmanBonus12(rand.Next(), s, s, n));
     154          descriptorList.Add(new FeynmanBonus13(rand.Next(), s, s, n));
     155          descriptorList.Add(new FeynmanBonus14(rand.Next(), s, s, n));
     156          descriptorList.Add(new FeynmanBonus15(rand.Next(), s, s, n));
     157          descriptorList.Add(new FeynmanBonus16(rand.Next(), s, s, n));
     158          descriptorList.Add(new FeynmanBonus17(rand.Next(), s, s, n));
     159          descriptorList.Add(new FeynmanBonus18(rand.Next(), s, s, n));
     160          descriptorList.Add(new FeynmanBonus19(rand.Next(), s, s, n));
     161          descriptorList.Add(new FeynmanBonus20(rand.Next(), s, s, n));
    142162        }
    143163      }
    144 
    145       descriptorList.Add(new FeynmanBonus1(rand.Next()));
    146       descriptorList.Add(new FeynmanBonus2(rand.Next()));
    147       descriptorList.Add(new FeynmanBonus3(rand.Next()));
    148       descriptorList.Add(new FeynmanBonus4(rand.Next()));
    149       descriptorList.Add(new FeynmanBonus5(rand.Next()));
    150       descriptorList.Add(new FeynmanBonus6(rand.Next()));
    151       descriptorList.Add(new FeynmanBonus7(rand.Next()));
    152       descriptorList.Add(new FeynmanBonus8(rand.Next()));
    153       descriptorList.Add(new FeynmanBonus9(rand.Next()));
    154       descriptorList.Add(new FeynmanBonus10(rand.Next()));
    155       descriptorList.Add(new FeynmanBonus11(rand.Next()));
    156       descriptorList.Add(new FeynmanBonus12(rand.Next()));
    157       descriptorList.Add(new FeynmanBonus13(rand.Next()));
    158       descriptorList.Add(new FeynmanBonus14(rand.Next()));
    159       descriptorList.Add(new FeynmanBonus15(rand.Next()));
    160       descriptorList.Add(new FeynmanBonus16(rand.Next()));
    161       descriptorList.Add(new FeynmanBonus17(rand.Next()));
    162       descriptorList.Add(new FeynmanBonus18(rand.Next()));
    163       descriptorList.Add(new FeynmanBonus19(rand.Next()));
    164       descriptorList.Add(new FeynmanBonus20(rand.Next()));
    165      
    166 
    167       var sortedList = descriptorList.OrderBy(x => x.Name).ToList();
    168 
    169 
    170       //descriptorList.Add(new FeynmanBonus1(rand.Next(), 100, 100));
    171       //descriptorList.Add(new FeynmanBonus2(rand.Next(), 100, 100));
    172       //descriptorList.Add(new FeynmanBonus3(rand.Next(), 100, 100));
    173       //descriptorList.Add(new FeynmanBonus4(rand.Next(), 100, 100));
    174       //descriptorList.Add(new FeynmanBonus5(rand.Next(), 100, 100));
    175       //descriptorList.Add(new FeynmanBonus6(rand.Next(), 100, 100));
    176       //descriptorList.Add(new FeynmanBonus7(rand.Next(), 100, 100));
    177       //descriptorList.Add(new FeynmanBonus8(rand.Next(), 100, 100));
    178       //descriptorList.Add(new FeynmanBonus9(rand.Next(), 100, 100));
    179       //descriptorList.Add(new FeynmanBonus10(rand.Next(), 100, 100));
    180       //descriptorList.Add(new FeynmanBonus11(rand.Next(), 100, 100));
    181       //descriptorList.Add(new FeynmanBonus12(rand.Next(), 100, 100));
    182       //descriptorList.Add(new FeynmanBonus13(rand.Next(), 100, 100));
    183       //descriptorList.Add(new FeynmanBonus14(rand.Next(), 100, 100));
    184       //descriptorList.Add(new FeynmanBonus15(rand.Next(), 100, 100));
    185       //descriptorList.Add(new FeynmanBonus16(rand.Next(), 100, 100));
    186       //descriptorList.Add(new FeynmanBonus17(rand.Next(), 100, 100));
    187       //descriptorList.Add(new FeynmanBonus18(rand.Next(), 100, 100));
    188       //descriptorList.Add(new FeynmanBonus19(rand.Next(), 100, 100));
    189       //descriptorList.Add(new FeynmanBonus20(rand.Next(), 100, 100));
    190 
    191 
    192       return sortedList;
     164      return descriptorList.OrderBy(x => x.Name).ToList();
    193165    }
    194166  }
Note: See TracChangeset for help on using the changeset viewer.