#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 SalutowiczFunctionOneDimensional : RegressionToyBenchmark { public SalutowiczFunctionOneDimensional() { Name = "Salutowicz"; 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: F2(X) = e^-X * X^3 * cos(X) * sin(X) * (cos(X)sin(X)^2 - 1)" + Environment.NewLine + "Training Data: 100 points X = (0.05:0.1:10)" + Environment.NewLine + "Test Data: 221 points X = (-0.5:0.05:10.5)" + Environment.NewLine + "Function Set: +, -, *, /, sqaure, x^real, x + real, x + real, e^x, e^-x, sin(x), cos(x)"; targetVariable = "Y"; inputVariables = new List() { "X" }; trainingPartition = new IntRange(0, 100); testPartition = new IntRange(101, 321); } protected override List GenerateTarget(List> data) { double x; List results = new List(); for (int i = 0; i < data[0].Count; i++) { x = data[0][i]; results.Add(Math.Exp(-x) * Math.Pow(x, 3) * Math.Cos(x) * Math.Sin(x) * (Math.Cos(x) * Math.Pow(Math.Sin(x), 2) - 1)); } return results; } protected override List> GenerateInput() { List> dataList = new List>(); dataList.Add(RegressionBenchmark.GenerateSteps(new DoubleRange(0.05, 10), 0.1)); dataList[0].AddRange(RegressionBenchmark.GenerateSteps(new DoubleRange(-0.5, 10.5), 0.05)); return dataList; } } }