Ignore:
Timestamp:
08/10/18 10:15:16 (14 months ago)
Author:
jkarder
Message:

#2933: added RandomSeedGenerator

Location:
trunk/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GBM/GradientBoostingRegressionAlgorithm.cs

    r15769 r16071  
    210210    protected override void Run(CancellationToken cancellationToken) {
    211211      // Set up the algorithm
    212       if (SetSeedRandomly) Seed = new System.Random().Next();
     212      if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    213213      var rand = new MersenneTwister((uint)Seed);
    214214
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/GradientBoostedTreesAlgorithm.cs

    r15583 r16071  
    186186    protected override void Run(CancellationToken cancellationToken) {
    187187      // Set up the algorithm
    188       if (SetSeedRandomly) Seed = new System.Random().Next();
     188      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
    189189
    190190      // Set up the results display
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/NonlinearRegression/NonlinearRegression.cs

    r15583 r16071  
    186186        qualityTable.Rows.Add(testRMSERow);
    187187        Results.Add(new Result(qualityTable.Name, qualityTable.Name + " for all restarts", qualityTable));
    188         if (SetSeedRandomly) Seed = (new System.Random()).Next();
     188        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    189189        var rand = new MersenneTwister((uint)Seed);
    190190        bestSolution = CreateRegressionSolution(Problem.ProblemData, ModelStructure, Iterations, ApplyLinearScaling, rand);
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestClassification.cs

    r15583 r16071  
    135135    protected override void Run(CancellationToken cancellationToken) {
    136136      double rmsError, relClassificationError, outOfBagRmsError, outOfBagRelClassificationError;
    137       if (SetSeedRandomly) Seed = new System.Random().Next();
     137      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
    138138
    139139      var model = CreateRandomForestClassificationModel(Problem.ProblemData, NumberOfTrees, R, M, Seed, out rmsError, out relClassificationError, out outOfBagRmsError, out outOfBagRelClassificationError);
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/RandomForest/RandomForestRegression.cs

    r15583 r16071  
    134134    protected override void Run(CancellationToken cancellationToken) {
    135135      double rmsError, avgRelError, outOfBagRmsError, outOfBagAvgRelError;
    136       if (SetSeedRandomly) Seed = new System.Random().Next();
     136      if (SetSeedRandomly) Seed = Random.RandomSeedGenerator.GetSeed();
    137137      var model = CreateRandomForestRegressionModel(Problem.ProblemData, NumberOfTrees, R, M, Seed,
    138138        out rmsError, out avgRelError, out outOfBagRmsError, out outOfBagAvgRelError);
  • trunk/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEAlgorithm.cs

    r15583 r16071  
    275275      if (wdist != null) wdist.Initialize(problemData);
    276276      if (state == null) {
    277         if (SetSeedRandomly) Seed = new System.Random().Next();
     277        if (SetSeedRandomly) Seed = RandomSeedGenerator.GetSeed();
    278278        var random = new MersenneTwister((uint)Seed);
    279279        var dataset = problemData.Dataset;
Note: See TracChangeset for help on using the changeset viewer.