Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/02/16 18:09:47 (8 years ago)
Author:
gkronber
Message:

#2371: added constructors to allow specification of random seeds for randomly generated regression problem instances (primarily for unit tests)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Friedman/FriedmanRandomFunctionInstanceProvider.cs

    r14110 r14228  
    4040      get { return "Friedman, Jerome H. 'Greedy function approximation: a gradient boosting machine.' Annals of statistics (2001): 1189-1232."; }
    4141    }
     42    public int Seed { get; }
     43
     44    public FriedmanRandomFunctionInstanceProvider() : base() {
     45    }
     46
     47    public FriedmanRandomFunctionInstanceProvider(int seed) : base() {
     48      Seed = seed;
     49    }
    4250
    4351    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
    4452      var numVariables = new int[] { 10, 25, 50, 100 };
    4553      var noiseRatios = new double[] { 0.01, 0.05, 0.1 };
    46       var rand = new System.Random(1234); // use fixed seed for deterministic problem generation
     54      var rand = new MersenneTwister((uint)Seed); // use fixed seed for deterministic problem generation
    4755      return (from size in numVariables
    4856              from noiseRatio in noiseRatios
Note: See TracChangeset for help on using the changeset viewer.