Free cookie consent management tool by TermsFeed Policy Generator

source: branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Benchmarks/3.4/RegressionBenchmarks/Vladislavleva/UnwrappedBallFunctionFiveDimensional.cs @ 7485

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

#1708:

  • changes according to mkommend's reviewing comments have been made
File size: 3.0 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22
23using System;
24using System.Collections.Generic;
25using HeuristicLab.Data;
26
27namespace HeuristicLab.Problems.DataAnalysis.Benchmarks {
28  public class UnwrappedBallFunctionFiveDimensional : RegressionToyBenchmark {
29
30    public UnwrappedBallFunctionFiveDimensional() {
31      Name = "Vladislavleva UBall5D";
32      Description = "Paper: Order of Nonlinearity as a Complexity Measure for Models Generated by Symbolic Regression via Pareto Genetic Programming " + Environment.NewLine
33        + "Authors: Ekaterina J. Vladislavleva, Member, IEEE, Guido F. Smits, Member, IEEE, and Dick den Hertog" + Environment.NewLine
34        + "Function: F4(X1, X2, X3, X4, X5) = 10 / (5 + Sum(Xi - 3)^2)" + Environment.NewLine
35        + "Training Data: 1024 points Xi = Rand(0.05, 6.05)" + Environment.NewLine
36        + "Test Data: 5000 points Xi = Rand(-0.25, 6.35)" + Environment.NewLine
37        + "Function Set: +, -, *, /, sqaure, x^real, x + real, x + real";
38      targetVariable = "Y";
39      inputVariables = new List<string>() { "X1", "X2", "X3", "X4", "X5" };
40      trainingPartition = new IntRange(0, 1024);
41      testPartition = new IntRange(1024, 6024);
42    }
43
44    protected override List<double> GenerateTarget(List<List<double>> data) {
45      double x1, x2, x3, x4, x5;
46      List<double> results = new List<double>();
47      for (int i = 0; i < data[0].Count; i++) {
48        x1 = data[0][i];
49        x2 = data[1][i];
50        x3 = data[2][i];
51        x4 = data[3][i];
52        x5 = data[4][i];
53        results.Add(10 / (5 + Math.Pow(x1 - 3, 2) + Math.Pow(x2 - 3, 2) + Math.Pow(x3 - 3, 2) + Math.Pow(x4 - 3, 2) + Math.Pow(x5 - 3, 2)));
54      }
55      return results;
56    }
57
58    protected override List<List<double>> GenerateInput() {
59      List<List<double>> dataList = new List<List<double>>();
60      DoubleRange testRange = new DoubleRange(0.05, 6.05);
61      DoubleRange trainingRange = new DoubleRange(-0.25, 6.35);
62      for (int i = 0; i < InputVariable.Count; i++) {
63        dataList.Add(RegressionBenchmark.GenerateUniformDistributedValues(1024, testRange));
64        dataList[i].AddRange(RegressionBenchmark.GenerateUniformDistributedValues(5000, trainingRange));
65      }
66
67      return dataList;
68    }
69  }
70}
Note: See TracBrowser for help on using the repository browser.