Free cookie consent management tool by TermsFeed Policy Generator

source: branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Regression/3.4/Keijzer/KeijzerFunctionEight.cs @ 7603

Last change on this file since 7603 was 7603, checked in by sforsten, 12 years ago

#1784:

  • first implementation of regression problem instances with one instance to test
File size: 2.0 KB
Line 
1using System;
2using System.Collections.Generic;
3
4namespace HeuristicLab.Problems.Instances.Regression {
5  public class KeijzerFunctionEight : ArtificialRegressionDataDescriptor {
6
7    public override string Name { get { return "Keijzer 8 f(x) = log(x)"; } }
8    public override string Description {
9      get {
10        return "Paper: Improving Symbolic Regression with Interval Arithmetic and Linear Scaling" + Environment.NewLine
11          + "Authors: Maarten Keijzer" + Environment.NewLine
12          + "Function: f(x) = log(x)" + Environment.NewLine
13          + "range(train): x = [0:1:100]" + Environment.NewLine
14          + "range(test): x = [0:0.1:100]" + Environment.NewLine
15          + "Function Set: x + y, x * y, 1/x, -x, sqrt(x)" + Environment.NewLine + Environment.NewLine
16          + "Note: The problem starts with 1 to avoid log(0), which is minus infinity!";
17      }
18    }
19    protected override string TargetVariable { get { return "F"; } }
20    protected override IEnumerable<string> InputVariables { get { return new List<string>() { "X", "F" }; } }
21    protected override IEnumerable<string> AllowedInputVariables { get { return new List<string>() { "X" }; } }
22    protected override int TrainingPartitionStart { get { return 0; } }
23    protected override int TrainingPartitionEnd { get { return 100; } }
24    protected override int TestPartitionStart { get { return 100; } }
25    protected override int TestPartitionEnd { get { return 1091; } }
26
27    protected override double[,] GenerateValues() {
28      List<List<double>> data = new List<List<double>>();
29      data.Add(ValueGenerator.GenerateSteps(1, 100, 1));
30      data[0].AddRange(ValueGenerator.GenerateSteps(1, 100, 0.1));
31
32      double x;
33      List<double> results = new List<double>();
34      for (int i = 0; i < data[0].Count; i++) {
35        x = data[0][i];
36        results.Add(Math.Log(x));
37      }
38      data.Add(results);
39
40      return ValueGenerator.Transformation(data);
41    }
42  }
43}
Note: See TracBrowser for help on using the repository browser.