Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3087_Ceres_Integration/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Feynman/FeynmanDescriptor.cs @ 18006

Last change on this file since 18006 was 18006, checked in by gkronber, 3 years ago

#3087: merged r17784:18004 from trunk to branch to prepare for trunk reintegration (fixed a conflict in CrossValidation.cs)

File size: 1.2 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Common;
7using HeuristicLab.Core;
8using HeuristicLab.Random;
9
10namespace HeuristicLab.Problems.Instances.DataAnalysis {
11  public abstract class FeynmanDescriptor : ArtificialRegressionDataDescriptor {
12    protected double? noiseRatio;
13    public override string Description {
14      get {
15        return "Feynman instances ... descriptions follows: " + Environment.NewLine;
16      }
17    }
18
19    public List<double> GetNoisyTarget(List<double> target, IRandom rand) {
20      if (noiseRatio == null) return null;
21
22      var targetNoise = new List<double>();
23      var sigmaNoise = Math.Sqrt(noiseRatio.Value) * target.StandardDeviationPop();
24      targetNoise.AddRange(target.Select(md => md + NormalDistributedRandomPolar.NextDouble(rand, 0, sigmaNoise)));
25      return targetNoise;
26
27    }
28
29    protected override int TrainingPartitionStart { get { return 0; } }
30    protected override int TrainingPartitionEnd { get { return 100; } }
31    protected override int TestPartitionStart { get { return 100; } }
32    protected override int TestPartitionEnd { get { return 200; } }
33  }
34}
Note: See TracBrowser for help on using the repository browser.