Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/23/16 12:57:27 (8 years ago)
Author:
gkronber
Message:

#2371: merged r14228, r14229 from trunk to stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.Instances.DataAnalysis

  • stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/FeatureSelection/FeatureSelectionInstanceProvider.cs

    r14186 r14305  
    4141      get { return ""; }
    4242    }
     43    public int Seed { get; private set; }
     44
     45    public FeatureSelectionInstanceProvider() : base() {
     46      Seed = (int)DateTime.Now.Ticks;
     47    }
     48
     49    public FeatureSelectionInstanceProvider(int seed) : base() {
     50      Seed = seed;
     51    }
     52
    4353
    4454    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
     
    4656      var pp = new double[] { 0.1, 0.25, 0.5 };
    4757      var noiseRatios = new double[] { 0.01, 0.05, 0.1, 0.2 };
    48       var mt = new MersenneTwister();
    49       var xGenerator = new NormalDistributedRandom(mt, 0, 1);
    50       var weightGenerator = new UniformDistributedRandom(mt, 0, 10);
     58      var rand = new MersenneTwister((uint)Seed); // use fixed seed for deterministic problem generation
     59
    5160      return (from size in sizes
    5261              from p in pp
    5362              from noiseRatio in noiseRatios
     63              let instanceSeed = rand.Next()
     64              let mt = new MersenneTwister((uint)instanceSeed)
     65              let xGenerator = new NormalDistributedRandom(mt, 0, 1)
     66              let weightGenerator = new UniformDistributedRandom(mt, 0, 10)
    5467              select new FeatureSelection(size, p, noiseRatio, xGenerator, weightGenerator))
    5568              .Cast<IDataDescriptor>()
Note: See TracChangeset for help on using the changeset viewer.