Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionMultiObjectiveMetaModelAnalyzer.cs @ 17776

Last change on this file since 17776 was 17776, checked in by dpiringe, 4 years ago

#3076:

  • changed SymbolicRegressionSingleObjectiveMetaModelAnalyzer to calculate the average quality of an solution for all problems
    • average: because we need to include outlier
  • some architectural changes
  • added new (but empty) meta model analyzer for multi objective -> SymbolicRegressionMultiObjectiveMetaModelAnalyzer
File size: 2.7 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
7using HEAL.Attic;
8using HeuristicLab.Common;
9using HeuristicLab.Optimization;
10
11namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
12  [StorableType("30B1B5C6-09D9-44C5-BC56-A57F3186E0D2")]
13  public class SymbolicRegressionMultiObjectiveMetaModelAnalyzer
14      : SymbolicRegressionMetaModelAnalyzer<SymbolicRegressionMultiObjectiveProblem>, ISymbolicExpressionTreeAnalyzer {
15
16    [StorableConstructor]
17    protected SymbolicRegressionMultiObjectiveMetaModelAnalyzer
18    (StorableConstructorFlag _) : base(_) {
19    }
20
21    protected SymbolicRegressionMultiObjectiveMetaModelAnalyzer(SymbolicRegressionMultiObjectiveMetaModelAnalyzer original, Cloner cloner)
22      : base(original, cloner) { }
23
24    public SymbolicRegressionMultiObjectiveMetaModelAnalyzer() {
25
26    }
27
28    public override IDeepCloneable Clone(Cloner cloner) =>
29      new SymbolicRegressionMultiObjectiveMetaModelAnalyzer(this, cloner);
30
31    protected override void PerformApply(
32      SymbolicRegressionMultiObjectiveProblem baseProblem,
33      IEnumerable<SymbolicRegressionMultiObjectiveProblem> problems,
34      string targetVariable) {
35     
36      //double bestQuality = problem.Maximization.Value ? double.MinValue : double.MaxValue;
37      //var trees = SymbolicExpressionTree.ToArray();
38      //IDataset dataset = problem.ProblemData.Dataset;
39      //IEnumerable<int> rows = Enumerable.Range(0, dataset.Rows);
40      //var paretoFront = DominationCalculator<ISymbolicExpressionTree>.CalculateBestParetoFront(trees,
41      //  trees.Select(x => problem.Evaluator.Evaluate(ExecutionContext, x, problem.ProblemData, rows)).ToArray(),
42      //  problem.Maximization.ToArray());
43
44      //SymbolicRegressionSolution bestMetaModel = null;
45      //foreach (var tree in this.SymbolicExpressionTree.ToArray()) { // iterate pareto front
46       
47      //  var quality = problem.Evaluator.Evaluate(ExecutionContext, tree, problem.ProblemData, rows);
48      //  /*
49      //  bool isBetter = problem.Maximization.Value ? (bestQuality < quality) : (bestQuality > quality);
50      //  if (isBetter) {
51      //    bestQuality = quality;
52      //    var model = new SymbolicRegressionModel(
53      //      targetVariable,
54      //      (ISymbolicExpressionTree)tree.Clone(),
55      //      new SymbolicDataAnalysisExpressionTreeInterpreter());
56      //    bestMetaModel = new SymbolicRegressionSolution(model, problem.ProblemData);
57      //  }*/
58      //}
59      //BestMetaModelParameter.ActualValue = bestMetaModel;
60    }
61  }
62}
Note: See TracBrowser for help on using the repository browser.