- Timestamp:
- 07/07/20 10:47:27 (4 years ago)
- 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 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus1() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus1() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus1(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus1(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus1(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 33 protected override string TargetVariable { get { return "A"; } }36 protected override string TargetVariable { get { return noiseRatio == null ? "A" : "A_noise"; } } 34 37 35 38 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"}; } 37 40 } 38 41 … … 72 75 73 76 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); 75 79 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); 76 88 } 77 89 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus10.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus10() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus10() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus10(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus10(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus10(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 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 35 42 protected override string[] AllowedInputVariables { get { return new[] {"c", "v", "theta2"}; } } 36 43 … … 62 69 } 63 70 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 64 79 return data; 65 80 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus11.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus11() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus11() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus11(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus11(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus11(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 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 35 42 protected override string[] AllowedInputVariables { get { return new[] {"I_0", "alpha", "delta", "n"}; } } 36 43 … … 61 68 for (var i = 0; i < I_0.Count; i++) { 62 69 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); 64 72 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); 65 81 } 66 82 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus12.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus12() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus12() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus12(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus12(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus12(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 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 35 42 protected override string[] AllowedInputVariables { get { return new[] {"q", "y", "Volt", "d", "epsilon"}; } } 36 43 … … 68 75 } 69 76 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 70 85 return data; 71 86 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus13.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus13() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus13() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus13(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus13(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus13(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"q", "r", "d", "alpha", "epsilon"}; } } 35 43 … … 61 69 62 70 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])); 64 73 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); 65 82 } 66 83 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus14.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus14() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus14() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus14(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus14(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus14(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"Ef", "theta", "r", "d", "alpha"}; } } 35 43 … … 66 74 } 67 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); 82 } 83 68 84 return data; 69 85 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus15.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus15() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus15() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus15(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus15(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus15(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"c", "v", "omega", "theta"}; } } 35 43 … … 64 72 } 65 73 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 66 82 return data; 67 83 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus16.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus16() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus16() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus16(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus16(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus16(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"m", "c", "p", "q", "A_vec", "Volt"}; } } 35 43 … … 63 71 64 72 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) + 66 74 Math.Pow(m[i], 2) * Math.Pow(c[i], 4)) + q[i] * Volt[i]; 67 75 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); 68 84 } 69 85 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus17.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus17() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus17() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus17(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus17(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus17(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"m", "omega", "p", "y", "x", "alpha"}; } } 35 43 … … 69 77 } 70 78 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 71 87 return data; 72 88 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus18.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus18() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus18() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus18(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus18(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus18(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 32 } 30 33 } 31 34 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 34 41 protected override string[] AllowedInputVariables { get { return new[] {"G", "k_f", "r", "H_G", "c"}; } } 35 42 … … 65 72 } 66 73 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 67 82 return data; 68 83 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus19.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus19() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus19() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus19(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus19(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus19(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"G", "k_f", "r", "H_G", "alpha", "c"}; } } 35 43 … … 68 76 } 69 77 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 70 86 return data; 71 87 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus2.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus2() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus2() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus2(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus2(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus2(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 33 protected override string TargetVariable { get { return "k"; } }36 protected override string TargetVariable { get { return noiseRatio == null ? "k" : "k_noise"; } } 34 37 35 38 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"}; } 37 40 } 38 41 … … 76 79 } 77 80 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 78 89 return data; 79 90 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus20.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus20() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus20() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus20(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus20(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus20(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 33 protected override string TargetVariable { get { return "A"; } }36 protected override string TargetVariable { get { return noiseRatio == null ? "A" : "A_noise"; } } 34 37 35 38 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"}; } 37 40 } 38 41 … … 73 76 for (var i = 0; i < omega.Count; i++) { 74 77 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)); 77 80 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); 78 89 } 79 90 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus3.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus3() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus3() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus3(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus3(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus3(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"d", "alpha", "theta1", "theta2"}; } } 35 43 … … 63 71 } 64 72 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 65 81 return data; 66 82 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus4.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus4() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus4() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus4(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus4(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus4(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 28 32 } 29 33 } 30 34 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 33 41 protected override string[] AllowedInputVariables { get { return new[] {"m", "E_n", "U", "L", "r"}; } } 34 42 … … 64 72 } 65 73 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 66 82 return data; 67 83 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus5.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus5() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus5() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus5(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus5(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus5(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 28 32 } 29 33 } 30 34 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 33 41 protected override string[] AllowedInputVariables { get { return new[] {"d", "G", "m1", "m2"}; } } 34 42 … … 58 66 59 67 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])); 61 69 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); 62 78 } 63 79 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus6.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus6() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus6() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus6(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus6(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus6(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 32 protected override string TargetVariable { get { return "alpha"; } }36 protected override string TargetVariable { get { return noiseRatio == null ? "alpha" : "alpha_noise"; } } 33 37 34 38 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 } 36 42 } 37 43 … … 72 78 for (var i = 0; i < epsilon.Count; i++) { 73 79 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))); 75 81 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); 76 90 } 77 91 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus7.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus7() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus7() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus7(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus7(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus7(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 32 } 30 33 } 31 34 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 34 41 protected override string[] AllowedInputVariables { get { return new[] {"G", "rho", "alpha", "c", "d"}; } } 35 42 … … 65 72 } 66 73 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 67 82 return data; 68 83 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus8.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus8() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus8() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus8(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus8(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus8(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 25 28 public override string Name { 26 29 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()); 29 33 } 30 34 } 31 35 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 34 42 protected override string[] AllowedInputVariables { get { return new[] {"E_n", "m", "c", "theta"}; } } 35 43 … … 63 71 } 64 72 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 65 81 return data; 66 82 } -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanBonus9.cs
r17643 r17649 2 2 using System.Collections.Generic; 3 3 using System.Linq; 4 using HeuristicLab.Common; 4 5 using HeuristicLab.Random; 5 6 … … 9 10 private readonly int trainingSamples; 10 11 11 public FeynmanBonus9() : this((int) DateTime.Now.Ticks, 10000, 10000 ) { }12 public FeynmanBonus9() : this((int) DateTime.Now.Ticks, 10000, 10000, null) { } 12 13 13 14 public FeynmanBonus9(int seed) { … … 15 16 trainingSamples = 10000; 16 17 testSamples = 10000; 18 noiseRatio = null; 17 19 } 18 20 19 public FeynmanBonus9(int seed, int trainingSamples, int testSamples ) {21 public FeynmanBonus9(int seed, int trainingSamples, int testSamples, double? noiseRatio) { 20 22 Seed = seed; 21 23 this.trainingSamples = trainingSamples; 22 24 this.testSamples = testSamples; 25 this.noiseRatio = noiseRatio; 23 26 } 24 27 … … 26 29 get { 27 30 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()); 30 33 } 31 34 } 32 35 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 35 42 protected override string[] AllowedInputVariables { get { return new[] {"G", "c", "m1", "m2", "r"}; } } 36 43 … … 62 69 63 70 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]) / 65 72 Math.Pow(r[i], 5); 66 73 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); 67 82 } 68 83 -
branches/3075_aifeynman_instances/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanInstanceProvider.cs
r17647 r17649 140 140 descriptorList.Add(new Feynman99(rand.Next(), s, s, n)); 141 141 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)); 142 162 } 143 163 } 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(); 193 165 } 194 166 }
Note: See TracChangeset
for help on using the changeset viewer.