Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/22/19 10:06:42 (5 years ago)
Author:
pfleck
Message:

#3040

  • Added double vectors for Dataset. Extended the type-checks for DataAnalysisProblemData.
  • Added a small benchmark instance with data containing vectors. Adapted the ArtificialRegressionDataDescriptor to be able to specify non-double values.
Location:
branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression
Files:
2 added
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ArtificialRegressionDataDescriptor.cs

    r17180 r17364  
    2020#endregion
    2121
     22using System.Collections;
    2223using System.Collections.Generic;
    2324using HeuristicLab.Problems.DataAnalysis;
     
    2627  public abstract class ArtificialRegressionDataDescriptor : RegressionDataDescriptor {
    2728    public IRegressionProblemData GenerateRegressionData() {
    28       Dataset dataset = new Dataset(VariableNames, this.GenerateValues());
     29      var values = GenerateValues();
     30      Dataset dataset = values != null
     31        ? new Dataset(VariableNames, GenerateValues())
     32        : new Dataset(VariableNames, GenerateValuesExtended());
    2933      return GenerateRegressionData(dataset);
    3034    }
    3135
    3236    protected abstract List<List<double>> GenerateValues();
     37
     38    protected virtual List<IList> GenerateValuesExtended() {
     39      return null;
     40    }
    3341  }
    3442}
  • branches/3040_VectorBasedGP/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/VectorData/VariousInstanceProvider.cs

    r17362 r17364  
    2525
    2626namespace HeuristicLab.Problems.Instances.DataAnalysis {
    27   public class VariousInstanceProvider : ArtificialRegressionInstanceProvider {
     27  public class VectorDataInstanceProvider : ArtificialRegressionInstanceProvider {
    2828    public override string Name {
    29       get { return "Various Benchmark Problems"; }
     29      get { return "Vector Data Benchmark Problems"; }
    3030    }
    3131    public override string Description {
     
    4040    public int Seed { get; private set; }
    4141
    42     public VariousInstanceProvider() : this((int)DateTime.Now.Ticks) { }
     42    public VectorDataInstanceProvider()
     43      : this((int)DateTime.Now.Ticks) { }
    4344
    44     public VariousInstanceProvider(int seed) : base() {
     45    public VectorDataInstanceProvider(int seed)
     46      : base() {
    4547      Seed = seed;
    4648    }
    4749    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    48       List<IDataDescriptor> descriptorList = new List<IDataDescriptor>();
    4950      var rand = new MersenneTwister((uint)Seed);
    50       descriptorList.Add(new BreimanOne(rand.Next()));
    51       descriptorList.Add(new FriedmanOne(rand.Next()));
    52       descriptorList.Add(new FriedmanTwo(rand.Next()));
    53       descriptorList.Add(new PolyTen(rand.Next()));
    54       descriptorList.Add(new SpatialCoevolution(rand.Next()));
    55       return descriptorList;
     51      return new List<IDataDescriptor> {
     52        new VectorDataTestOne(rand.Next())
     53      };
    5654    }
    5755  }
Note: See TracChangeset for help on using the changeset viewer.