Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3057_DynamicALPS/TestProblems/oesr-alps-master/HeuristicLab.Algorithms.OESRALPS/Analyzers/Regression/SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer.cs @ 17717

Last change on this file since 17717 was 17479, checked in by kyang, 5 years ago

#3057

  1. upload the latest version of ALPS with SMS-EMOA
  2. upload the related dynamic test problems (dynamic, single-objective symbolic regression), written by David Daninel.
File size: 3.3 KB
Line 
1using HEAL.Attic;
2using HeuristicLab.Common;
3using HeuristicLab.Core;
4using HeuristicLab.Data;
5using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
6using HeuristicLab.Optimization;
7using HeuristicLab.Parameters;
8using HeuristicLab.Problems.DataAnalysis;
9using HeuristicLab.Problems.DataAnalysis.Symbolic;
10using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
11using System;
12using System.Collections.Generic;
13using System.Linq;
14using System.Text;
15using System.Threading.Tasks;
16
17namespace HeuristicLab.Algorithms.OESRALPS.Analyzers.Regression
18{
19    [Item("SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer", "An operator that analyzes the training best symbolic regression solution for single objective symbolic regression problems.")]
20    [StorableType("85786F8E-A81D-4909-9A66-620669A0C7FB")]
21    public sealed class SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer
22        : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer<ISymbolicRegressionSolution, ISymbolicRegressionSingleObjectiveEvaluator, IRegressionProblemData>,
23        ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator
24    {
25        private const string ProblemDataParameterName = "ProblemData";
26        private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter";
27        private const string EstimationLimitsParameterName = "EstimationLimits";
28
29        #region parameter properties
30        public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
31            get { return (IValueLookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
32        }
33        #endregion
34
35        [StorableConstructor]
36        private SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(StorableConstructorFlag _) : base(_) { }
37        private SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer original, Cloner cloner) : base(original, cloner) { }
38        public SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer()
39          : base()
40        {
41            Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model."));
42        }
43        public override IDeepCloneable Clone(Cloner cloner)
44        {
45            return new SymbolicRegressionSingleObjectiveTrainingBestSolutionSlidingWindowAnalyzer(this, cloner);
46        }
47
48        protected override ISymbolicRegressionSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality)
49        {
50            var model = new SymbolicRegressionModel(ProblemDataParameter.ActualValue.TargetVariable, (ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
51            if (ApplyLinearScalingParameter.ActualValue.Value) model.Scale(ProblemDataParameter.ActualValue);
52            return new SymbolicRegressionSolution(model, (IRegressionProblemData)ProblemDataParameter.ActualValue.Clone());
53        }
54    }
55}
Note: See TracBrowser for help on using the repository browser.