Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7025


Ignore:
Timestamp:
11/21/11 16:23:48 (13 years ago)
Author:
sforsten
Message:

#1669: benchmark problems of Nguyen, Korns and Keijzer from http://groups.csail.mit.edu/EVO-DesignOpt/GPBenchmarks/ have been added. The benchmark problems from http://www.vanillamodeling.com/ have been adapted to the ones from Vladislavleva.

Not all benchmarks are working correctly so far, but they will be tested soon.

Location:
branches/RegressionBenchmarks
Files:
47 added
8 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Benchmarks/3.4/Benchmark.cs

    r6968 r7025  
    2929      : base(original, cloner) {
    3030    }
     31
     32    public override IDeepCloneable Clone(Cloner cloner) {
     33      throw new System.NotImplementedException();
     34    }
    3135  }
    3236}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Benchmarks/3.4/Generator/RegressionBenchmark.cs

    r6991 r7025  
    2020#endregion
    2121
    22 using System.Collections;
    2322using System.Collections.Generic;
    2423using System.Linq;
     
    3130
    3231    #region properties
    33     public abstract List<string> InputVariable { get; }
    34     public abstract string TargetVariable { get; }
    35     public abstract IntRange TrainingPartition { get; }
    36     public abstract IntRange TestPartition { get; }
     32    protected string targetVariable;
     33    protected List<string> inputVariables;
     34    protected IntRange trainingPartition;
     35    protected IntRange testPartition;
     36
     37    public List<string> InputVariable {
     38      get { return inputVariables; }
     39    }
     40
     41    public string TargetVariable {
     42      get { return targetVariable; }
     43    }
     44
     45    public IntRange TrainingPartition {
     46      get { return trainingPartition; }
     47    }
     48
     49    public IntRange TestPartition {
     50      get { return testPartition; }
     51    }
    3752    #endregion
    3853
     
    4257    }
    4358
    44     protected abstract List<double> CalculateFunction(Dictionary<string, IList<double>> data);
     59    protected abstract List<double> CalculateFunction(List<List<double>> data);
    4560
    46     protected abstract Dictionary<string, IList<double>> GenerateInput(Dictionary<string, IList<double>> data);
     61    protected abstract List<List<double>> GenerateInput(List<List<double>> dataList);
    4762
    4863    public IDataAnalysisProblemData GenerateProblemData() {
    49       Dictionary<string, IList<double>> data = new Dictionary<string, IList<double>>();
    50       data.Add(this.TargetVariable, new List<double>());
    51       foreach (var variable in this.InputVariable) {
    52         data.Add(variable, new List<double>());
    53       }
     64      List<string> varNames = new List<string>();
     65      varNames.Add(this.TargetVariable);
     66      varNames.AddRange(InputVariable);
    5467
    55       data = GenerateInput(data);
     68      List<List<double>> dataList = GenerateInput(new List<List<double>>());
    5669
    57       List<IList> values = new List<IList>();
    58       foreach (var valueList in data.Values) {
    59         values.Add((IList)valueList);
    60       }
     70      dataList.Insert(0, CalculateFunction(dataList));
    6171
    62       Dataset dataset = new Dataset(data.Keys, values);
    63       dataset.Name = this.Name;
     72      Dataset dataset = new Dataset(varNames, dataList);
    6473
    6574      RegressionProblemData problemData = new RegressionProblemData(dataset, dataset.DoubleVariables.Skip(1), dataset.DoubleVariables.First());
    6675
    6776      problemData.Name = "Data generated for benchmark problem \"" + this.Name + "\"";
    68 
     77      problemData.Description = this.Description;
    6978
    7079      problemData.TestPartition.Start = this.TestPartition.Start;
     
    7786    }
    7887
    79     //private Dictionary<string, IList<double>> CalculateValues(Dictionary<string, IList<double>> data, DatasetDefinition dataDef) {
    80     //  Random rand = new Random();
    81     //  var combinationDataSet = AllCombinationsOf(dataDef.RangeVariables.Values.Select(range => range.Values).ToList());
    82     //  int index = 0;
    83     //  var help = dataDef.RangeVariables.Keys;
    84     //  foreach (var dataSet in combinationDataSet) {
    85     //    data[help.ElementAt(index)] = dataSet;
    86     //    index++;
    87     //  }
    88     //  List<string> vars = new List<string>(dataDef.RandomVariables.Keys);
    89     //  for (int i = 0; i < dataDef.AmountOfPoints; i++) {
    90     //    foreach (var variable in vars) {
    91     //      data[variable].Add(dataDef.RandomVariables[variable].Next());
    92     //    }
    93     //    //  data[TargetVariable].Add(CalculateFunction(data, vars));
    94     //  }
    95     //  int bla = 0;
    96     //  var test = data.Values.Select((ind) => (ind.ElementAt(bla)));
    97 
    98     //  return data;
    99     //}
    100 
    101     public static List<double> generateSteps(DoubleRange range, double stepWidth) {
     88    public static List<double> GenerateSteps(DoubleRange range, double stepWidth) {
    10289      return Enumerable.Range(0, (int)((range.End - range.Start) / stepWidth) + 1)
    10390                                      .Select(i => (range.Start + i * stepWidth))
     
    10592    }
    10693
    107     public static List<double> generateUniformDistributedValues(int amount, DoubleRange range) {
     94    public static List<double> GenerateUniformDistributedValues(int amount, DoubleRange range) {
    10895      List<double> values = new List<double>();
    10996      System.Random rand = new System.Random();
     
    114101    }
    115102
    116     public static List<double> generateNormalDistributedValues(int amount, double mu, double sigma) {
     103    public static List<double> GenerateNormalDistributedValues(int amount, double mu, double sigma) {
    117104      List<double> values = new List<double>();
    118105      FastRandom rand = new FastRandom();
     
    133120        combinations = AddExtraSet(combinations, set);
    134121
     122      combinations = (from i in Enumerable.Range(0, sets.Count)
     123                      select (from list in combinations
     124                              select list.ElementAt(i)).ToList<double>()).ToList<List<double>>();
     125
    135126      return combinations;
    136127    }
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Benchmarks/3.4/HeuristicLab.Problems.DataAnalysis.Benchmarks-3.4.csproj

    r6991 r7025  
    5151    <Compile Include="Plugin.cs" />
    5252    <Compile Include="Properties\AssemblyInfo.cs" />
    53     <Compile Include="RegressionBenchmarks\KotanchekFunction.cs" />
     53    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionSixteen.cs" />
     54    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionFifteen.cs" />
     55    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionThirteen.cs" />
     56    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionTwelve.cs" />
     57    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionEight.cs" />
     58    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionSeven.cs" />
     59    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionSix.cs" />
     60    <Compile Include="RegressionBenchmarks\Korns\KornFunctionFiveteen.cs" />
     61    <Compile Include="RegressionBenchmarks\Korns\KornFunctionFourteen.cs" />
     62    <Compile Include="RegressionBenchmarks\Korns\KornFunctionThirteen.cs" />
     63    <Compile Include="RegressionBenchmarks\Korns\KornFunctionTwelve.cs" />
     64    <Compile Include="RegressionBenchmarks\Korns\KornFunctionEleven.cs" />
     65    <Compile Include="RegressionBenchmarks\Korns\KornFunctionTen.cs" />
     66    <Compile Include="RegressionBenchmarks\Korns\KornFunctionNine.cs" />
     67    <Compile Include="RegressionBenchmarks\Korns\KornFunctionEight.cs" />
     68    <Compile Include="RegressionBenchmarks\Korns\KornFunctionSeven.cs" />
     69    <Compile Include="RegressionBenchmarks\Korns\KornFunctionSix.cs" />
     70    <Compile Include="RegressionBenchmarks\Korns\KornFunctionFive.cs" />
     71    <Compile Include="RegressionBenchmarks\Korns\KornFunctionFour.cs" />
     72    <Compile Include="RegressionBenchmarks\Korns\KornFunctionThree.cs" />
     73    <Compile Include="RegressionBenchmarks\Korns\KornFunctionTwo.cs" />
     74    <Compile Include="RegressionBenchmarks\Korns\KornFunctionOne.cs" />
     75    <Compile Include="RegressionBenchmarks\Keijzer\KeijzerFunctionFour.cs" />
     76    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionTwelve.cs" />
     77    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionEleven.cs" />
     78    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionTen.cs" />
     79    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionNine.cs" />
     80    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionEight.cs" />
     81    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionSeven.cs" />
     82    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionSix.cs" />
     83    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionFive.cs" />
     84    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionFour.cs" />
     85    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionThree.cs" />
     86    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionTwo.cs" />
     87    <Compile Include="RegressionBenchmarks\Nguyen et al\NguyenFunctionOne.cs" />
     88    <Compile Include="RegressionBenchmarks\Vladislavleva et al\KotanchekFunction.cs" />
    5489    <Compile Include="Generator\RegressionBenchmark.cs" />
     90    <Compile Include="RegressionBenchmarks\Vladislavleva et al\RationalPolynomialThreeDimensional.cs" />
     91    <Compile Include="RegressionBenchmarks\Vladislavleva et al\RationalPolynomialTwoDimensional.cs" />
     92    <Compile Include="RegressionBenchmarks\Vladislavleva et al\RippleFunction.cs" />
     93    <Compile Include="RegressionBenchmarks\Vladislavleva et al\SalustowiczFunctionOneDimensional.cs" />
     94    <Compile Include="RegressionBenchmarks\Vladislavleva et al\SalustowiczFunctionTwoDimensional.cs" />
     95    <Compile Include="RegressionBenchmarks\Vladislavleva et al\SineCosineFunction.cs" />
     96    <Compile Include="RegressionBenchmarks\Vladislavleva et al\UnwrappedBallFunctionFiveDimensional.cs" />
    5597  </ItemGroup>
    5698  <ItemGroup>
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs

    r6968 r7025  
    107107    IDataAnalysisProblemData IDataAnalysisProblem.ProblemData {
    108108      get { return ProblemData; }
     109      set { ProblemData = (T)value; }
     110
    109111    }
    110112    public T ProblemData {
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Views/3.4/DataAnalysisProblemView.cs

    r6968 r7025  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using System.Windows.Forms;
     
    5859    private void loadButton_Click(object sender, EventArgs e) {
    5960      if (benchmarkComboBox.SelectedItem != null)
    60         Content.CreateProblemDataFromBenchmark((IDataAnalysisBenchmarkProblemDataGenerator)benchmarkComboBox.SelectedItem);
     61        Content.ProblemData = ((IDataAnalysisBenchmarkProblemDataGenerator)benchmarkComboBox.SelectedItem).GenerateProblemData();
    6162    }
    6263
     
    6465      base.OnContentChanged();
    6566      benchmarkComboBox.Items.Clear();
    66       benchmarkComboBox.Items.AddRange(Content.GetBenchmarkProblemDataGenerators().OrderBy(b => b.ItemName).ToArray());
     67      benchmarkComboBox.Items.AddRange(GetBenchmarkProblemDataGenerators().OrderBy(b => b.ItemName).ToArray());
    6768      if (benchmarkComboBox.Items.Count > 0)
    6869        benchmarkComboBox.SelectedIndex = 0;
    6970    }
     71
     72    protected IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators() {
     73      if (Content is IRegressionProblem)
     74        return ApplicationManager.Manager.GetInstances<IRegressionBenchmarkProblemDataGenerator>();
     75      else if (Content is IClassificationProblem)
     76        return ApplicationManager.Manager.GetInstances<IClassificationBenchmarkProblemDataGenerator>();
     77      else if (Content is ITimeSeriesPrognosisProblem)
     78        return ApplicationManager.Manager.GetInstances<ITimeSeriesBenchmarkProblemDataGenerator>();
     79      else if (Content is IClusteringProblem)
     80        return ApplicationManager.Manager.GetInstances<IClusteringBenchmarkProblemDataGenerator>();
     81      return new List<IDataAnalysisBenchmarkProblemDataGenerator>();
     82    }
    7083  }
    7184}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationProblem.cs

    r6968 r7025  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
    2524using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.PluginInfrastructure;
    2725
    2826namespace HeuristicLab.Problems.DataAnalysis {
     
    4543      ProblemData = problemData;
    4644    }
    47 
    48     public override void CreateProblemDataFromBenchmark(IDataAnalysisBenchmarkProblemDataGenerator benchmarkGenerator) {
    49       throw new System.NotImplementedException();
    50     }
    51 
    52     public override IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators() {
    53       return ApplicationManager.Manager.GetInstances<IClassificationBenchmarkProblemDataGenerator>();
    54     }
    5545  }
    5646}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Clustering/ClusteringProblem.cs

    r6968 r7025  
    2323using HeuristicLab.Core;
    2424using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    25 using HeuristicLab.PluginInfrastructure;
    2625
    2726namespace HeuristicLab.Problems.DataAnalysis {
     
    4443      ProblemData = problemData;
    4544    }
    46 
    47     public override void CreateProblemDataFromBenchmark(IDataAnalysisBenchmarkProblemDataGenerator benchmarkGenerator) {
    48       throw new System.NotImplementedException();
    49     }
    50 
    51     public override System.Collections.Generic.IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators() {
    52       return ApplicationManager.Manager.GetInstances<IClusteringBenchmarkProblemDataGenerator>();
    53     }
    5445  }
    5546}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/DataAnalysisProblem.cs

    r6968 r7025  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using HeuristicLab.Common;
    2524using HeuristicLab.Core;
     
    4645    IDataAnalysisProblemData IDataAnalysisProblem.ProblemData {
    4746      get { return ProblemData; }
     47      set { ProblemData = (T)value; }
    4848    }
    4949    public T ProblemData {
     
    9393
    9494    public abstract void ImportProblemDataFromFile(string fileName);
    95 
    96     public abstract void CreateProblemDataFromBenchmark(IDataAnalysisBenchmarkProblemDataGenerator benchmarkGenerator);
    97 
    98     public abstract IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators();
    9995  }
    10096}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblem.cs

    r6968 r7025  
    2020#endregion
    2121
    22 using System;
    23 using System.Collections.Generic;
    2422using HeuristicLab.Common;
    2523using HeuristicLab.Core;
    2624using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using HeuristicLab.PluginInfrastructure;
    2825
    2926namespace HeuristicLab.Problems.DataAnalysis {
     
    4643      ProblemData = problemData;
    4744    }
    48 
    49     public override IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators() {
    50       return ApplicationManager.Manager.GetInstances<IRegressionBenchmarkProblemDataGenerator>();
    51     }
    52 
    53     public override void CreateProblemDataFromBenchmark(IDataAnalysisBenchmarkProblemDataGenerator benchmarkGenerator) {
    54       if (!(benchmarkGenerator is IRegressionBenchmarkProblemDataGenerator)) {
    55         throw new ArgumentException("BenchmarkGenerator is not an IRegressionBenchmarkProblemDataGenerator.");
    56       }
    57 
    58       IDataAnalysisProblemData problemData = benchmarkGenerator.GenerateProblemData();
    59 
    60       if (problemData is IRegressionProblemData)
    61         ProblemData = (IRegressionProblemData)problemData;
    62       else
    63         throw new InvalidCastException("ProblemDataGenerator didn't return an IRegressionProblemData.");
    64     }
    6545  }
    6646}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblem.cs

    r6968 r7025  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Common;
    2423using HeuristicLab.Core;
    2524using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.PluginInfrastructure;
    2725
    2826namespace HeuristicLab.Problems.DataAnalysis {
     
    4543      ProblemData = problemData;
    4644    }
    47 
    48     public override void CreateProblemDataFromBenchmark(IDataAnalysisBenchmarkProblemDataGenerator benchmarkGenerator) {
    49       throw new System.NotImplementedException();
    50     }
    51 
    52     public override IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators() {
    53       return ApplicationManager.Manager.GetInstances<ITimeSeriesBenchmarkProblemDataGenerator>();
    54     }
    5545  }
    5646}
  • branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/IDataAnalysisProblem.cs

    r6968 r7025  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using HeuristicLab.Core;
    2524using HeuristicLab.Optimization;
     
    2827  public interface IDataAnalysisProblem : IProblem {
    2928    IParameter ProblemDataParameter { get; }
    30     IDataAnalysisProblemData ProblemData { get; }
     29    IDataAnalysisProblemData ProblemData { get; set; }
    3130    event EventHandler ProblemDataChanged;
    3231
    3332    void ImportProblemDataFromFile(string fileName);
    34     void CreateProblemDataFromBenchmark(IDataAnalysisBenchmarkProblemDataGenerator benchmarkGenerator);
    35     IEnumerable<IDataAnalysisBenchmarkProblemDataGenerator> GetBenchmarkProblemDataGenerators();
    3633  }
    3734
Note: See TracChangeset for help on using the changeset viewer.