Beispiel #1
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            List <double>         oneVariableTestData = SequenceGenerator.GenerateSteps(-0.2m, 4.2m, 0.1m).Select(v => (double)v).ToList();
            List <List <double> > testData            = new List <List <double> >()
            {
                oneVariableTestData, oneVariableTestData
            };
            var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList <IEnumerable <double> >();
            var rand         = new MersenneTwister((uint)Seed);

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data.Add(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), 100, 0.3, 4).ToList());
                data[i].AddRange(combinations[i]);
            }

            double        x1, x2;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x1 = data[0][i];
                x2 = data[1][i];
                results.Add(Math.Exp(-Math.Pow(x1 - 1, 2)) / (1.2 + Math.Pow(x2 - 2.5, 2)));
            }
            data.Add(results);

            return(data);
        }
Beispiel #2
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            List <double>         evenlySpacedSequence = SequenceGenerator.GenerateSteps(-5, 5, 0.4m).Select(v => (double)v).ToList();
            List <List <double> > trainingData         = new List <List <double> >()
            {
                evenlySpacedSequence, evenlySpacedSequence
            };
            var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(trainingData).ToList();
            var rand         = new MersenneTwister((uint)Seed);

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data.Add(combinations[i].ToList());
                data[i].AddRange(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), 1000, -5, 5).ToList());
            }

            double        x, y;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x = data[0][i];
                y = data[1][i];
                results.Add(1 / (1 + Math.Pow(x, -4)) + 1 / (1 + Math.Pow(y, -4)));
            }
            data.Add(results);

            return(data);
        }
Beispiel #3
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();
            List <double>         oneVariableTestData = SequenceGenerator.GenerateSteps(-3, 3, 0.1m).Select(v => (double)v).ToList();
            List <List <double> > testData            = new List <List <double> >()
            {
                oneVariableTestData, oneVariableTestData
            };

            var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList();
            var rand         = new MersenneTwister((uint)Seed);

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data.Add(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), 20, -3, 3).ToList());
                data[i].AddRange(combinations[i]);
            }

            double        x, y;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x = data[0][i];
                y = data[1][i];
                results.Add(x * x * x / 5.0 + y * y * y / 2.0 - y - x);
            }
            data.Add(results);

            return(data);
        }
Beispiel #4
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            List <double>         oneVariableTestData = SequenceGenerator.GenerateSteps(0, 1, 0.01m).Select(v => (double)v).ToList();
            List <List <double> > testData            = new List <List <double> >()
            {
                oneVariableTestData, oneVariableTestData
            };

            var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList <IEnumerable <double> >();

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data.Add(ValueGenerator.GenerateUniformDistributedValues(100, 0, 1).ToList());
                data[i].AddRange(combinations[i]);
            }

            double        x, y;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x = data[0][i];
                y = data[1][i];
                results.Add(Math.Pow(x, y));
            }
            data.Add(results);

            return(data);
        }
Beispiel #5
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();
            List <double>         oneVariableTestData = SequenceGenerator.GenerateSteps(-0.05m, 6.05m, 0.02m).Select(v => (double)v).ToList();
            List <List <double> > testData            = new List <List <double> >()
            {
                oneVariableTestData, oneVariableTestData
            };
            var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList <IEnumerable <double> >();

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data.Add(ValueGenerator.GenerateUniformDistributedValues(30, 0.1, 5.9).ToList());
                data[i].AddRange(combinations[i]);
            }

            double        x1, x2;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x1 = data[0][i];
                x2 = data[1][i];
                results.Add(6 * Math.Sin(x1) * Math.Cos(x2));
            }
            data.Add(results);

            return(data);
        }
    protected override List<List<double>> GenerateValues() {
      List<List<double>> data = new List<List<double>>();
      data.Add(SequenceGenerator.GenerateSteps(-2, 2, 0.1m).Select(v => (double)v).ToList());
      data[0].AddRange(SequenceGenerator.GenerateSteps(-2, 2, 0.001m).Select(v => (double)v));

      double x;
      List<double> results = new List<double>();
      for (int i = 0; i < data[0].Count; i++) {
        x = data[0][i];
        results.Add(0.3 * x * Math.Sin(2 * Math.PI * x));
      }
      data.Add(results);

      return data;
    }
Beispiel #7
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            data.Add(SequenceGenerator.GenerateSteps(1m, 50, 1).Select(v => (double)v).ToList());
            data[0].AddRange(SequenceGenerator.GenerateSteps(1m, 120, 1).Select(v => (double)v));

            double        x;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x = data[0][i];
                results.Add(Enumerable.Range(1, (int)x).Sum(j => 1.0 / j));
            }
            data.Add(results);

            return(data);
        }
Beispiel #8
0
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            data.Add(SequenceGenerator.GenerateSteps(1m, 100, 1).Select(v => (double)v).ToList());
            data[0].AddRange(SequenceGenerator.GenerateSteps(1m, 100, 0.1m).Select(v => (double)v));

            double        x;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x = data[0][i];
                results.Add(Math.Log(x));
            }
            data.Add(results);

            return(data);
        }
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            data.Add(SequenceGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList());
            data[0].AddRange(SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v));

            double        x;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x = data[0][i];
                results.Add(Math.Exp(-x) * Math.Pow(x, 3) * Math.Cos(x) * Math.Sin(x) * (Math.Cos(x) * Math.Pow(Math.Sin(x), 2) - 1));
            }
            data.Add(results);

            return(data);
        }
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data = new List <List <double> >();

            int n    = 300;
            var rand = new MersenneTwister((uint)Seed);

            data.Add(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), n, 0.05, 2).ToList());
            data.Add(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), n, 1, 2).ToList());
            data.Add(ValueGenerator.GenerateUniformDistributedValues(rand.Next(), n, 0.05, 2).ToList());

            List <List <double> > testData = new List <List <double> >()
            {
                SequenceGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList(),
                SequenceGenerator.GenerateSteps(0.95m, 2.05m, 0.1m).Select(v => (double)v).ToList(),
                SequenceGenerator.GenerateSteps(-0.05m, 2.05m, 0.15m).Select(v => (double)v).ToList()
            };

            var combinations = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList <IEnumerable <double> >();

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data[i].AddRange(combinations[i]);
            }

            double        x1, x2, x3;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x1 = data[0][i];
                x2 = data[1][i];
                x3 = data[2][i];
                results.Add(30 * ((x1 - 1) * (x3 - 1)) / (Math.Pow(x2, 2) * (x1 - 10)));
            }
            data.Add(results);

            return(data);
        }
        protected override List <List <double> > GenerateValues()
        {
            List <List <double> > data         = new List <List <double> >();
            List <List <double> > trainingData = new List <List <double> >()
            {
                SequenceGenerator.GenerateSteps(0.05m, 10, 0.1m).Select(v => (double)v).ToList(),
                SequenceGenerator.GenerateSteps(0.05m, 10.05m, 2).Select(v => (double)v).ToList()
            };

            List <List <double> > testData = new List <List <double> >()
            {
                SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.05m).Select(v => (double)v).ToList(),
                SequenceGenerator.GenerateSteps(-0.5m, 10.5m, 0.5m).Select(v => (double)v).ToList()
            };

            var trainingComb = ValueGenerator.GenerateAllCombinationsOfValuesInLists(trainingData).ToList <IEnumerable <double> >();
            var testComb     = ValueGenerator.GenerateAllCombinationsOfValuesInLists(testData).ToList <IEnumerable <double> >();

            for (int i = 0; i < AllowedInputVariables.Count(); i++)
            {
                data.Add(trainingComb[i].ToList());
                data[i].AddRange(testComb[i]);
            }

            double        x1, x2;
            List <double> results = new List <double>();

            for (int i = 0; i < data[0].Count; i++)
            {
                x1 = data[0][i];
                x2 = data[1][i];
                results.Add(Math.Exp(-x1) * Math.Pow(x1, 3) * Math.Cos(x1) * Math.Sin(x1) * (Math.Cos(x1) * Math.Pow(Math.Sin(x1), 2) - 1) * (x2 - 5));
            }
            data.Add(results);

            return(data);
        }