public void GaussianProcessRegressionPerformanceTest()
        {
            ex = null;

            var alg = new GaussianProcessRegression();

            alg.Engine          = new HeuristicLab.SequentialEngine.SequentialEngine();
            alg.SetSeedRandomly = false;

            alg.Problem = new RegressionProblem();
            var provider    = new RegressionCSVInstanceProvider();
            var problemData = (RegressionProblemData)provider.ImportData(@"Test Resources\co2.txt");

            problemData.TargetVariableParameter.ActualValue = problemData.TargetVariableParameter.ValidValues.First(x => x.Value == "interpolated");
            problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "year"), false);
            problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "month"), false);
            problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "average"), false);
            problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "interpolated"), false);
            problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "trend"), false);
            problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "#days"), false);

            alg.Problem.ProblemDataParameter.Value = problemData;

            alg.ExceptionOccurred += new EventHandler <EventArgs <Exception> >(cv_ExceptionOccurred);

            alg.Prepare();
            alg.Start();
            if (ex != null)
            {
                throw ex;
            }

            TestContext.WriteLine("Runtime: {0}", alg.ExecutionTime.ToString());
        }
    public void GaussianProcessRegressionPerformanceTest() {
      ex = null;

      var alg = new GaussianProcessRegression();
      alg.Engine = new HeuristicLab.SequentialEngine.SequentialEngine();

      alg.Problem = new RegressionProblem();
      var provider = new RegressionCSVInstanceProvider();
      var problemData = (RegressionProblemData)provider.ImportData(@"Test Resources\co2.txt");
      problemData.TargetVariableParameter.ActualValue = problemData.TargetVariableParameter.ValidValues.First(x => x.Value == "interpolated");
      problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "year"), false);
      problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "month"), false);
      problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "average"), false);
      problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "interpolated"), false);
      problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "trend"), false);
      problemData.InputVariables.SetItemCheckedState(problemData.InputVariables.First(x => x.Value == "#days"), false);

      alg.Problem.ProblemDataParameter.Value = problemData;

      alg.ExceptionOccurred += new EventHandler<EventArgs<Exception>>(cv_ExceptionOccurred);
      alg.Stopped += new EventHandler(cv_Stopped);

      alg.Prepare();
      alg.Start();
      trigger.WaitOne();
      if (ex != null) throw ex;

      TestContext.WriteLine("Runtime: {0}", alg.ExecutionTime.ToString());
    }
        private GaussianProcessRegression CreateGaussianProcessRegressionSample()
        {
            var gpr        = new GaussianProcessRegression();
            var provider   = new VariousInstanceProvider();
            var instance   = provider.GetDataDescriptors().Where(x => x.Name.Contains("Spatial co-evolution")).Single();
            var regProblem = new RegressionProblem();

            regProblem.Load(provider.LoadData(instance));

            #region Algorithm Configuration
            gpr.Name        = "Gaussian Process Regression";
            gpr.Description = "A Gaussian process regression algorithm which solves the spatial co-evolution benchmark problem";
            gpr.Problem     = regProblem;

            gpr.CovarianceFunction     = new CovarianceSquaredExponentialIso();
            gpr.MeanFunction           = new MeanConst();
            gpr.MinimizationIterations = 20;
            gpr.Seed            = 0;
            gpr.SetSeedRandomly = true;
            #endregion

            gpr.Engine = new ParallelEngine.ParallelEngine();
            return(gpr);
        }