Free cookie consent management tool by TermsFeed Policy Generator

Changeset 12292


Ignore:
Timestamp:
04/07/15 14:56:24 (10 years ago)
Author:
pfleck
Message:

#2301 Removed the GenerateSteps from the ValueGenerator and put it into the new SequenceGenerator.
Adapted DataAnalysis-Instances and scripts (samples and unit tests).

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  
    143143    <Compile Include="Plugin.cs" />
    144144    <Compile Include="ReferenceEqualityComparer.cs" />
     145    <Compile Include="SequenceGenerator.cs" />
    145146    <Compile Include="TimeSpanHelper.cs" />
    146147    <Compile Include="TypeEqualityComparer.cs" />
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEight.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionEleven.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950    protected override List<List<double>> GenerateValues() {
    5051      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();
    5253      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5354
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFifteen.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFour.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950    protected override List<List<double>> GenerateValues() {
    5051      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));
    5354
    5455      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionFourteen.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionNine.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionOne.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSeven.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950    protected override List<List<double>> GenerateValues() {
    5051      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));
    5354
    5455      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionSix.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTen.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051
    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();
    5253      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5354
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThirteen.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionThree.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwelve.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Keijzer/KeijzerFunctionTwo.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/ValueGenerator.cs

    r12012 r12292  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
    2423using System.Linq;
    25 using HeuristicLab.Common;
    2624using HeuristicLab.Random;
    2725
    2826namespace HeuristicLab.Problems.Instances.DataAnalysis {
    29   public static class ValueGenerator {
     27  internal static class ValueGenerator {
    3028    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 types
    44       // http://referencesource.microsoft.com/#System.Core/System/Linq/Enumerable.cs#27bb217a6d5457ec
    45       // http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx     
    46 
    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     }
    7329
    7430    /// <summary>
     
    10056    }
    10157
    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.
    10360    public static IEnumerable<IEnumerable<double>> GenerateAllCombinationsOfValuesInLists(List<List<double>> lists) {
    10461      List<List<double>> allCombinations = new List<List<double>>();
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Various/SpatialCoevolution.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    5354      List<List<double>> data = new List<List<double>>();
    5455
    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();
    5657      List<List<double>> trainingData = new List<List<double>>() { evenlySpacedSequence, evenlySpacedSequence };
    5758      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(trainingData).ToList();
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/KotanchekFunction.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051
    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();
    5253      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5354      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>();
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialThreeDimensional.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4445    protected override int TrainingPartitionEnd { get { return 300; } }
    4546    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); } }
    4748
    4849    protected override List<List<double>> GenerateValues() {
     
    5556
    5657      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()
    6061      };
    6162
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/RationalPolynomialTwoDimensional.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051
    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();
    5253
    5354      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionOneDimensional.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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));
    5253
    5354      double x;
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SalutowiczFunctionTwoDimensional.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4950      List<List<double>> data = new List<List<double>>();
    5051      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()
    5354      };
    5455
    5556      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()
    5859      };
    5960
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Vladislavleva/SineCosineFunction.cs

    r12012 r12292  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using HeuristicLab.Common;
    2526
    2627namespace HeuristicLab.Problems.Instances.DataAnalysis {
     
    4849    protected override List<List<double>> GenerateValues() {
    4950      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();
    5152      List<List<double>> testData = new List<List<double>>() { oneVariableTestData, oneVariableTestData };
    5253      var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList<IEnumerable<double>>();
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFClassificationScriptSource.cs

    r11890 r12292  
    44
    55using HeuristicLab.Algorithms.DataAnalysis;
     6using HeuristicLab.Common;
    67using HeuristicLab.Problems.DataAnalysis;
    7 using HeuristicLab.Problems.Instances.DataAnalysis;
    88using HeuristicLab.Scripting;
    99
     
    2929  */
    3030  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) }
    3434  };
    3535
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchRFRegressionScriptSource.cs

    r11890 r12292  
    44
    55using HeuristicLab.Algorithms.DataAnalysis;
     6using HeuristicLab.Common;
    67using HeuristicLab.Problems.DataAnalysis;
    7 using HeuristicLab.Problems.Instances.DataAnalysis;
    88using HeuristicLab.Random;
    99using HeuristicLab.Scripting;
     
    3030  */
    3131  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) }
    3535  };
    3636
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMClassificationScriptSource.cs

    r11789 r12292  
    55
    66using HeuristicLab.Algorithms.DataAnalysis;
     7using HeuristicLab.Common;
    78using HeuristicLab.Core;
    89using HeuristicLab.Data;
    910using HeuristicLab.Parameters;
    1011using HeuristicLab.Problems.DataAnalysis;
    11 using HeuristicLab.Problems.Instances.DataAnalysis;
    1212using HeuristicLab.Scripting;
    1313
     
    3838        { "svm_type", new List<double> {svm_parameter.NU_SVC } },
    3939        { "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) }
    4545  };
    4646
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Scripting-3.3/Script Sources/GridSearchSVMRegressionScriptSource.cs

    r11789 r12292  
    55
    66using HeuristicLab.Algorithms.DataAnalysis;
     7using HeuristicLab.Common;
    78using HeuristicLab.Core;
    89using HeuristicLab.Data;
    910using HeuristicLab.Parameters;
    1011using HeuristicLab.Problems.DataAnalysis;
    11 using HeuristicLab.Problems.Instances.DataAnalysis;
    1212using HeuristicLab.Scripting;
    1313
     
    3838        { "svm_type", new List<double> {svm_parameter.NU_SVR } },
    3939        { "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) }
    4545  };
    4646
Note: See TracChangeset for help on using the changeset viewer.