Changeset 14305 for stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/BreimanOne.cs
- Timestamp:
- 09/23/16 12:57:27 (8 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14228-14229
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis merged: 14228-14229
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/BreimanOne.cs
r14186 r14305 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Core; 25 26 using HeuristicLab.Random; 26 27 … … 43 44 protected override int TestPartitionEnd { get { return 10001; } } 44 45 45 protected static FastRandom rand = new FastRandom(); 46 public int Seed { get; private set; } 47 48 public BreimanOne() : this((int)DateTime.Now.Ticks) { } 49 public BreimanOne(int seed) : base() { 50 Seed = seed; 51 } 46 52 47 53 protected override List<List<double>> GenerateValues() { 48 54 List<List<double>> data = new List<List<double>>(); 49 55 List<int> values = new List<int>() { -1, 1 }; 50 data.Add(GenerateUniformIntegerDistribution(values, TestPartitionEnd)); 56 var rand = new MersenneTwister((uint)Seed); 57 data.Add(GenerateUniformIntegerDistribution(rand, values, TestPartitionEnd)); 51 58 values.Add(0); 52 59 for (int i = 0; i < AllowedInputVariables.Count() - 1; i++) { 53 data.Add(GenerateUniformIntegerDistribution( values, TestPartitionEnd));60 data.Add(GenerateUniformIntegerDistribution(rand, values, TestPartitionEnd)); 54 61 } 55 56 62 double x1, x2, x3, x4, x5, x6, x7; 57 63 double f; … … 79 85 } 80 86 81 private List<double> GenerateUniformIntegerDistribution( List<int> classes, int amount) {87 private List<double> GenerateUniformIntegerDistribution(IRandom rand, List<int> classes, int amount) { 82 88 List<double> values = new List<double>(); 83 89 for (int i = 0; i < amount; i++) {
Note: See TracChangeset
for help on using the changeset viewer.