#region License Information /* HeuristicLab * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using HeuristicLab.Data; namespace HeuristicLab.Problems.DataAnalysis.Benchmarks { public class RationalPolynomialTwoDimensional : RegressionToyBenchmark { public RationalPolynomialTwoDimensional() { Name = "Vladislavleva RatPol2D"; Description = "Paper: Order of Nonlinearity as a Complexity Measure for Models Generated by Symbolic Regression via Pareto Genetic Programming " + Environment.NewLine + "Authors: Ekaterina J. Vladislavleva, Member, IEEE, Guido F. Smits, Member, IEEE, and Dick den Hertog" + Environment.NewLine + "Function: F8(X1, X2) = ((X1 - 3)^4 + (X2 - 3)^3 - (X2 -3)) / ((X2 - 2)^4 + 10)" + Environment.NewLine + "Training Data: 50 points X1, X2 = Rand(0.05, 6.05)" + Environment.NewLine + "Test Data: 1157 points X1, X2 = (-0.25:0.2:6.35)" + Environment.NewLine + "Function Set: +, -, *, /, sqaure, x^real, x + real, x + real"; targetVariable = "Y"; inputVariables = new List() { "X1", "X2" }; trainingPartition = new IntRange(0, 50); testPartition = new IntRange(51, 1207); } protected override List GenerateTarget(List> data) { double x1, x2; List results = new List(); for (int i = 0; i < data[0].Count; i++) { x1 = data[0][i]; x2 = data[1][i]; results.Add((Math.Pow(x1 - 3, 4) + Math.Pow(x2 - 3, 3) - x2 + 3) / (Math.Pow(x2 - 2, 4) + 10)); } return results; } protected override List> GenerateInput() { List> dataList = new List>(); DoubleRange trainingRange = new DoubleRange(0.05, 6.05); for (int i = 0; i < InputVariable.Count; i++) { dataList.Add(RegressionBenchmark.GenerateUniformDistributedValues(TrainingPartition.End, trainingRange)); } List oneVariableTestData = RegressionBenchmark.GenerateSteps(new DoubleRange(-0.25, 6.35), 0.2); List> testData = new List>() { oneVariableTestData, oneVariableTestData }; testData = RegressionBenchmark.GenerateAllCombinationsOfValuesInLists(testData); for (int i = 0; i < InputVariable.Count; i++) { dataList[i].AddRange(testData[i]); } return dataList; } } }