1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
7 | using HEAL.Attic;
|
---|
8 | using HeuristicLab.Common;
|
---|
9 | using HeuristicLab.Optimization;
|
---|
10 |
|
---|
11 | namespace 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 | }
|
---|