Free cookie consent management tool by TermsFeed Policy Generator

source: branches/GaussianProcessEvolution/HeuristicLab.Problems.GaussianProcessTuning/GaussianProcessRegressionModel.cs @ 8754

Last change on this file since 8754 was 8753, checked in by gkronber, 12 years ago

#1967 initial import of Gaussian process evolution plugin

File size: 2.3 KB
Line 
1using System.Collections.Generic;
2using System.Linq;
3using HeuristicLab.Common;
4using HeuristicLab.Core;
5using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
6using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
7using HeuristicLab.Problems.DataAnalysis;
8
9namespace HeuristicLab.Problems.GaussianProcessTuning {
10  [StorableClass]
11  [Item("GaussianProcessRegressionModel", "A Gaussian process model")]
12  public class GaussianProcessRegressionModel : NamedItem, IRegressionModel {
13    [Storable]
14    private ISymbolicExpressionTree configuration;
15    public ISymbolicExpressionTree Configuration { get { return configuration; } }
16
17    [Storable]
18    private IRegressionProblemData trainingData;
19    [Storable]
20    private Interpreter interpreter;
21
22    [StorableConstructor]
23    protected GaussianProcessRegressionModel(bool deserializing) : base(deserializing) { }
24    protected GaussianProcessRegressionModel(GaussianProcessRegressionModel original, Cloner cloner)
25      : base(original, cloner) {
26      this.configuration = cloner.Clone(original.configuration);
27      this.trainingData = cloner.Clone(original.trainingData);
28      this.interpreter = cloner.Clone(original.interpreter);
29    }
30    public GaussianProcessRegressionModel(ISymbolicExpressionTree configuration, IRegressionProblemData trainingData, Interpreter interpreter) {
31      this.Name = "GaussianProcessRegressionModel";
32      this.Description = "A Gaussian process model";
33      this.configuration = configuration;
34      this.trainingData = trainingData;
35      this.interpreter = interpreter;
36    }
37    public override IDeepCloneable Clone(Cloner cloner) {
38      return new GaussianProcessRegressionModel(this, cloner);
39    }
40
41    public IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData) {
42      return new Solution(this, problemData);
43    }
44
45    public IEnumerable<double> GetEstimatedValues(Dataset dataset, IEnumerable<int> rows) {
46      //if (!rows.Any()) return Enumerable.Empty<double>();
47
48      //double[] means, variances;
49      //interpreter.EvaluateGaussianProcessConfiguration(configuration, trainingData, dataset, rows, out means,
50      //                                                 out variances);
51      //return means;
52      return rows.Select(x => 0.0);
53    }
54  }
55}
Note: See TracBrowser for help on using the repository browser.