Changeset 12292
- Timestamp:
- 04/07/15 14:56:24 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r11623 r12292 143 143 <Compile Include="Plugin.cs" /> 144 144 <Compile Include="ReferenceEqualityComparer.cs" /> 145 <Compile Include="SequenceGenerator.cs" /> 145 146 <Compile Include="TimeSpanHelper.cs" /> 146 147 <Compile Include="TypeEqualityComparer.cs" /> -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEight.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(0m, 100, 0.1m).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(0m, 100, 0.1m).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEleven.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 protected override List<List<double>> GenerateValues() { 50 51 List<List<double>> data = new List<List<double>>(); 51 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();52 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList(); 52 53 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 53 54 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFifteen.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();51 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList(); 51 52 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 52 53 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFour.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 protected override List<List<double>> GenerateValues() { 50 51 List<List<double>> data = new List<List<double>>(); 51 data.Add( ValueGenerator.GenerateSteps(0, 10, 0.05m).Select(v => (double)v).ToList());52 data[0].AddRange( ValueGenerator.GenerateSteps(0.05m, 10.05m, 0.05m).Select(v => (double)v));52 data.Add(SequenceGenerator.GenerateSteps(0, 10, 0.05m).Select(v => (double)v).ToList()); 53 data[0].AddRange(SequenceGenerator.GenerateSteps(0.05m, 10.05m, 0.05m).Select(v => (double)v)); 53 54 54 55 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFourteen.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double) v).ToList();51 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double) v).ToList(); 51 52 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 52 53 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionNine.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(0, 100, 0.1m).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(0m, 100, 1).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(0, 100, 0.1m).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionOne.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(-1, 1, 0.1m).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(-1, 1, 0.001m).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(-1, 1, 0.1m).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(-1, 1, 0.001m).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSeven.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 protected override List<List<double>> GenerateValues() { 50 51 List<List<double>> data = new List<List<double>>(); 51 data.Add( ValueGenerator.GenerateSteps(1m, 100, 1).Select(v => (double)v).ToList());52 data[0].AddRange( ValueGenerator.GenerateSteps(1m, 100, 0.1m).Select(v => (double)v));52 data.Add(SequenceGenerator.GenerateSteps(1m, 100, 1).Select(v => (double)v).ToList()); 53 data[0].AddRange(SequenceGenerator.GenerateSteps(1m, 100, 0.1m).Select(v => (double)v)); 53 54 54 55 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSix.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(1m, 50, 1).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(1m, 120, 1).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(1m, 50, 1).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(1m, 120, 1).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTen.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 List<List<double>> data = new List<List<double>>(); 50 51 51 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(0, 1, 0.01m).Select(v => (double)v).ToList();52 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(0, 1, 0.01m).Select(v => (double)v).ToList(); 52 53 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 53 54 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThirteen.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();51 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList(); 51 52 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 52 53 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThree.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(-3, 3, 0.1m).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(-3, 3, 0.001m).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(-3, 3, 0.1m).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(-3, 3, 0.001m).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwelve.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList();51 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.01m).Select(v => (double)v).ToList(); 51 52 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 52 53 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwo.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(-2, 2, 0.1m).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(-2, 2, 0.001m).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(-2, 2, 0.1m).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(-2, 2, 0.001m).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ValueGenerator.cs
r12012 r12292 20 20 #endregion 21 21 22 using System;23 22 using System.Collections.Generic; 24 23 using System.Linq; 25 using HeuristicLab.Common;26 24 using HeuristicLab.Random; 27 25 28 26 namespace HeuristicLab.Problems.Instances.DataAnalysis { 29 publicstatic class ValueGenerator {27 internal static class ValueGenerator { 30 28 private static FastRandom rand = new FastRandom(); 31 32 /// <summary>33 /// Generates a sequence of evenly spaced points by returning the start value and adding the stepwidth until the end is reached or surpassed.34 ///35 /// </summary>36 /// <param name="start">The smallest and first value of the sequence.</param>37 /// <param name="end">The largest and last value of the sequence.</param>38 /// <param name="stepWidth">The step size between subsequent values.</param>39 /// <param name="includeEnd">Determines if the end should be included in the sequence regardless if the end is divisible by the stepwidth.</param>40 /// <returns>A sequence of values from start to end (inclusive)</returns>41 [Obsolete("It is recommended to use the decimal overload to achieve a higher numerical accuracy.")]42 public static IEnumerable<double> GenerateSteps(double start, double end, double stepWidth, bool includeEnd = false) {43 //mkommend: IEnumerable.Cast fails due to boxing and unboxing of the involved types44 // http://referencesource.microsoft.com/#System.Core/System/Linq/Enumerable.cs#27bb217a6d5457ec45 // http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx46 47 return GenerateSteps((decimal)start, (decimal)end, (decimal)stepWidth, includeEnd).Select(x => (double)x);48 }49 50 /// <summary>51 /// Generates a sequence of evenly spaced points by returning the start value and adding the stepwidth until the end is reached or surpassed.52 /// </summary>53 /// <param name="start">The smallest and first value of the sequence.</param>54 /// <param name="end">The largest and last value of the sequence.</param>55 /// <param name="stepWidth">The step size between subsequent values.</param>56 /// /// <param name="includeEnd">Determines if the end should be included in the sequence regardless if the end is divisible by the stepwidth.</param>57 /// <returns>A sequence of values from start to end</returns>58 public static IEnumerable<decimal> GenerateSteps(decimal start, decimal end, decimal stepWidth, bool includeEnd = false) {59 if (stepWidth == 0)60 throw new ArgumentException("The step width cannot be zero.");61 if (start < end && stepWidth < 0)62 throw new ArgumentException("The step width must be larger than zero for increasing sequences (start < end).");63 if (start > end && stepWidth > 0)64 throw new ArgumentException("The step width must be smaller than zero for decreasing sequences (start > end).");65 66 decimal x = start;67 while (x <= end) {68 yield return x;69 x += stepWidth;70 }71 if (x - stepWidth < end && includeEnd) yield return end;72 }73 29 74 30 /// <summary> … … 100 56 } 101 57 102 // iterative approach 58 // Generate the cartesian product. 59 // The result is transposed, therefore the inner lists represent a column of values instead of a combination-pair. 103 60 public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> lists) { 104 61 List<List<double>> allCombinations = new List<List<double>>(); -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/SpatialCoevolution.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 53 54 List<List<double>> data = new List<List<double>>(); 54 55 55 List<double> evenlySpacedSequence = ValueGenerator.GenerateSteps(-5, 5, 0.4m).Select(v => (double)v).ToList();56 List<double> evenlySpacedSequence = SequenceGenerator.GenerateSteps(-5, 5, 0.4m).Select(v => (double)v).ToList(); 56 57 List<List<double>> trainingData = new List<List<double>>() { evenlySpacedSequence, evenlySpacedSequence }; 57 58 var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(trainingData).ToList(); -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/KotanchekFunction.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 List<List<double>> data = new List<List<double>>(); 50 51 51 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-0.2m, 4.2m, 0.1m).Select(v => (double)v).ToList();52 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-0.2m, 4.2m, 0.1m).Select(v => (double)v).ToList(); 52 53 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 53 54 var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>(); -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialThreeDimensional.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 44 45 protected override int TrainingPartitionEnd { get { return 300; } } 45 46 protected override int TestPartitionStart { get { return 300; } } 46 protected override int TestPartitionEnd { get { return 300 + (15 *12*15); } }47 protected override int TestPartitionEnd { get { return 300 + (15 * 12 * 15); } } 47 48 48 49 protected override List<List<double>> GenerateValues() { … … 55 56 56 57 List<List<double>> testData = new List<List<double>>() { 57 ValueGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList(),58 ValueGenerator.GenerateSteps( 0.95m, 2.05m, 0.1m).Select(v => (double)v).ToList(),59 ValueGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList()58 SequenceGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList(), 59 SequenceGenerator.GenerateSteps( 0.95m, 2.05m, 0.1m).Select(v => (double)v).ToList(), 60 SequenceGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList() 60 61 }; 61 62 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialTwoDimensional.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 List<List<double>> data = new List<List<double>>(); 50 51 51 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-0.25m, 6.35m, 0.2m).Select(v => (double)v).ToList();52 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-0.25m, 6.35m, 0.2m).Select(v => (double)v).ToList(); 52 53 53 54 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionOneDimensional.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 data.Add( ValueGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList());51 data[0].AddRange( ValueGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v));51 data.Add(SequenceGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList()); 52 data[0].AddRange(SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v)); 52 53 53 54 double x; -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionTwoDimensional.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 49 50 List<List<double>> data = new List<List<double>>(); 50 51 List<List<double>> trainingData = new List<List<double>>() { 51 ValueGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList(),52 ValueGenerator.GenerateSteps(0.05m, 10.05m, 2).Select(v => (double)v).ToList()52 SequenceGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList(), 53 SequenceGenerator.GenerateSteps(0.05m, 10.05m, 2).Select(v => (double)v).ToList() 53 54 }; 54 55 55 56 List<List<double>> testData = new List<List<double>>() { 56 ValueGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v).ToList(),57 ValueGenerator.GenerateSteps(-0.5m, 10.5m, 0.5m).Select(v => (double)v).ToList()57 SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v).ToList(), 58 SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.5m).Select(v => (double)v).ToList() 58 59 }; 59 60 -
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SineCosineFunction.cs
r12012 r12292 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using HeuristicLab.Common; 25 26 26 27 namespace HeuristicLab.Problems.Instances.DataAnalysis { … … 48 49 protected override List<List<double>> GenerateValues() { 49 50 List<List<double>> data = new List<List<double>>(); 50 List<double> oneVariableTestData = ValueGenerator.GenerateSteps(-0.05m, 6.05m, 0.02m).Select(v => (double)v).ToList();51 List<double> oneVariableTestData = SequenceGenerator.GenerateSteps(-0.05m, 6.05m, 0.02m).Select(v => (double)v).ToList(); 51 52 List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData }; 52 53 var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>(); -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFClassificationScriptSource.cs
r11890 r12292 4 4 5 5 using HeuristicLab.Algorithms.DataAnalysis; 6 using HeuristicLab.Common; 6 7 using HeuristicLab.Problems.DataAnalysis; 7 using HeuristicLab.Problems.Instances.DataAnalysis;8 8 using HeuristicLab.Scripting; 9 9 … … 29 29 */ 30 30 static Dictionary<string, IEnumerable<double>> randomForestParameterRanges = new Dictionary<string, IEnumerable<double>> { 31 { "N", ValueGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) },32 { "R", ValueGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) },33 { "M", ValueGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) }31 { "N", SequenceGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) }, 32 { "R", SequenceGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) }, 33 { "M", SequenceGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) } 34 34 }; 35 35 -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFRegressionScriptSource.cs
r11890 r12292 4 4 5 5 using HeuristicLab.Algorithms.DataAnalysis; 6 using HeuristicLab.Common; 6 7 using HeuristicLab.Problems.DataAnalysis; 7 using HeuristicLab.Problems.Instances.DataAnalysis;8 8 using HeuristicLab.Random; 9 9 using HeuristicLab.Scripting; … … 30 30 */ 31 31 static Dictionary<string, IEnumerable<double>> randomForestParameterRanges = new Dictionary<string, IEnumerable<double>> { 32 { "N", ValueGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) },33 { "R", ValueGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) },34 { "M", ValueGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) }32 { "N", SequenceGenerator.GenerateSteps(5m, 10, 1).Select(x => Math.Pow(2,(double)x)) }, 33 { "R", SequenceGenerator.GenerateSteps(0.05m, 0.66m, 0.05m).Select(x => (double)x) }, 34 { "M", SequenceGenerator.GenerateSteps(0.1m, 1, 0.1m).Select(x => (double)x) } 35 35 }; 36 36 -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMClassificationScriptSource.cs
r11789 r12292 5 5 6 6 using HeuristicLab.Algorithms.DataAnalysis; 7 using HeuristicLab.Common; 7 8 using HeuristicLab.Core; 8 9 using HeuristicLab.Data; 9 10 using HeuristicLab.Parameters; 10 11 using HeuristicLab.Problems.DataAnalysis; 11 using HeuristicLab.Problems.Instances.DataAnalysis;12 12 using HeuristicLab.Scripting; 13 13 … … 38 38 { "svm_type", new List<double> {svm_parameter.NU_SVC } }, 39 39 { "kernel_type", new List<double> { svm_parameter.RBF }}, 40 { "C", ValueGenerator.GenerateSteps(-1m, 10, 1).Select(x => Math.Pow(2,(double)x)) },41 { "gamma", ValueGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2,(double)x)) },42 // { "eps", ValueGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) },43 { "nu" , ValueGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) },44 // { "degree", ValueGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) }40 { "C", SequenceGenerator.GenerateSteps(-1m, 10, 1).Select(x => Math.Pow(2,(double)x)) }, 41 { "gamma", SequenceGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2,(double)x)) }, 42 // { "eps", SequenceGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) }, 43 { "nu" , SequenceGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) }, 44 // { "degree", SequenceGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) } 45 45 }; 46 46 -
trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMRegressionScriptSource.cs
r11789 r12292 5 5 6 6 using HeuristicLab.Algorithms.DataAnalysis; 7 using HeuristicLab.Common; 7 8 using HeuristicLab.Core; 8 9 using HeuristicLab.Data; 9 10 using HeuristicLab.Parameters; 10 11 using HeuristicLab.Problems.DataAnalysis; 11 using HeuristicLab.Problems.Instances.DataAnalysis;12 12 using HeuristicLab.Scripting; 13 13 … … 38 38 { "svm_type", new List<double> {svm_parameter.NU_SVR } }, 39 39 { "kernel_type", new List<double> { svm_parameter.RBF }}, 40 { "C", ValueGenerator.GenerateSteps(-1m, 12, 1).Select(x => Math.Pow(2, (double)x)) },41 { "gamma", ValueGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2, (double)x)) },42 // { "eps", ValueGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) },43 { "nu" , ValueGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) },44 // { "degree", ValueGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) }40 { "C", SequenceGenerator.GenerateSteps(-1m, 12, 1).Select(x => Math.Pow(2, (double)x)) }, 41 { "gamma", SequenceGenerator.GenerateSteps(-4m, -1, 1).Select(x => Math.Pow(2, (double)x)) }, 42 // { "eps", SequenceGenerator.GenerateSteps(-8m, -1, 1).Select(x => Math.Pow(2, (double)x)) }, 43 { "nu" , SequenceGenerator.GenerateSteps(-10m, 0, 1m).Select(x => Math.Pow(2, (double)x)) }, 44 // { "degree", SequenceGenerator.GenerateSteps(1m, 4, 1).Select(x => (double)x) } 45 45 }; 46 46
Note: See TracChangeset
for help on using the changeset viewer.