- Timestamp:
- 07/11/15 19:44:35 (9 years ago)
- Location:
- stable
- Files:
-
- 37 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12292-12293
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r11920 r12740 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" /> -
stable/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/DefineArithmeticProgressionDialog.cs
r12009 r12740 23 23 using System.ComponentModel; 24 24 using System.Globalization; 25 using System.Linq;26 25 using System.Windows.Forms; 27 26 using HeuristicLab.Common; … … 31 30 private bool allowOnlyInteger; 32 31 33 public d oubleMinimum { get; private set; }34 public d oubleMaximum { get; private set; }35 public d oubleStep { get; private set; }32 public decimal Minimum { get; private set; } 33 public decimal Maximum { get; private set; } 34 public decimal Step { get; private set; } 36 35 37 public IEnumerable<d ouble> Values {38 get { return EnumerateProgression().Reverse(); }36 public IEnumerable<decimal> Values { 37 get { return SequenceGenerator.GenerateSteps(Minimum, Maximum, Step, includeEnd: true); } 39 38 } 40 39 … … 48 47 this.allowOnlyInteger = allowOnlyInteger; 49 48 } 50 public DefineArithmeticProgressionDialog(bool allowOnlyInteger, d ouble minimum, double maximum, doublestep)49 public DefineArithmeticProgressionDialog(bool allowOnlyInteger, decimal minimum, decimal maximum, decimal step) 51 50 : this(allowOnlyInteger) { 52 51 Minimum = minimum; … … 63 62 private void textBox_Validating(object sender, CancelEventArgs e) { 64 63 var textBox = (TextBox)sender; 65 d oublevalue = 0;64 decimal value = 0; 66 65 if (allowOnlyInteger) { 67 66 int intValue; … … 75 74 } 76 75 } else { 77 if (!d ouble.TryParse(textBox.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out value)) {76 if (!decimal.TryParse(textBox.Text, NumberStyles.Float, CultureInfo.CurrentCulture.NumberFormat, out value)) { 78 77 errorProvider.SetError(textBox, "Please enter a valid double value."); 79 78 e.Cancel = true; … … 90 89 return Minimum <= Maximum && Step >= 0; 91 90 } 92 93 private IEnumerable<double> EnumerateProgression() {94 double value = Maximum;95 bool minimumIncluded = false;96 int i = 1;97 while (value >= Minimum) {98 if (value.IsAlmost(Minimum)) {99 yield return Minimum;100 minimumIncluded = true;101 } else yield return value;102 103 if (Step == 0) break; // a step size of 0 will only output maximum and minimum104 if (allowOnlyInteger) {105 value = (int)Maximum - i * (int)Step;106 } else {107 value = Maximum - i * Step;108 }109 i++;110 }111 if (!minimumIncluded) {112 yield return Minimum;113 }114 }115 91 } 116 92 } -
stable/HeuristicLab.Optimizer
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Optimizer merged: 12292-12293
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimizer/3.3/CreateExperimentDialog.cs
r12009 r12740 264 264 var parameter = (IValueParameter)generateButton.Tag; 265 265 bool integerOnly = intParameters.ContainsKey(parameter); 266 d oublemin = 0, max = 1, step = 1;266 decimal min = 0, max = 1, step = 1; 267 267 #region Try to calculate some meaningful values 268 268 if (integerOnly) { … … 276 276 int len = doubleParameters[parameter].Length; 277 277 if (len > 0) { 278 min = doubleParameters[parameter].Min();279 max = doubleParameters[parameter].Max();280 step = len >= 2 ? Math.Abs(( doubleParameters[parameter][len - 1] - doubleParameters[parameter][len - 2])) : 1;278 min = (decimal)doubleParameters[parameter].Min(); 279 max = (decimal)doubleParameters[parameter].Max(); 280 step = len >= 2 ? Math.Abs(((decimal)doubleParameters[parameter][len - 1] - (decimal)doubleParameters[parameter][len - 2])) : 1m; 281 281 } 282 282 } … … 292 292 } else { 293 293 doubleParameters[parameter].Reset -= new EventHandler(ValuesArray_Reset); 294 doubleParameters[parameter] = new DoubleArray(values. ToArray());294 doubleParameters[parameter] = new DoubleArray(values.Select(x => (double)x).ToArray()); 295 295 doubleParameters[parameter].Reset += new EventHandler(ValuesArray_Reset); 296 296 stringConvertibleArrayView.Content = doubleParameters[parameter]; -
stable/HeuristicLab.Problems.Instances.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis merged: 12292
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEight.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEleven.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFifteen.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFour.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFourteen.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionNine.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionOne.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSeven.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSix.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTen.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThirteen.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThree.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwelve.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwo.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ValueGenerator.cs
r12009 r12740 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>>(); -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/SpatialCoevolution.cs
r12009 r12740 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(); -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/KotanchekFunction.cs
r12009 r12740 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>>(); -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialThreeDimensional.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialTwoDimensional.cs
r12009 r12740 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 }; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionOneDimensional.cs
r12009 r12740 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; -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionTwoDimensional.cs
r12009 r12740 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 -
stable/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SineCosineFunction.cs
r12009 r12740 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>>(); -
stable/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 12292
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFClassificationScriptSource.cs
r11907 r12740 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 -
stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFRegressionScriptSource.cs
r11907 r12740 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 -
stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMClassificationScriptSource.cs
r11789 r12740 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 -
stable/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMRegressionScriptSource.cs
r11789 r12740 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.