1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
4 | *
|
---|
5 | * This file is part of HeuristicLab.
|
---|
6 | *
|
---|
7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | */
|
---|
20 | #endregion
|
---|
21 |
|
---|
22 | using HeuristicLab.Core;
|
---|
23 | using HeuristicLab.DataAnalysis;
|
---|
24 | using HeuristicLab.GP.Interfaces;
|
---|
25 | using HeuristicLab.Operators;
|
---|
26 | using HeuristicLab.Modeling;
|
---|
27 | using HeuristicLab.Logging;
|
---|
28 | using HeuristicLab.Data;
|
---|
29 |
|
---|
30 | namespace HeuristicLab.GP.StructureIdentification.TimeSeries {
|
---|
31 | internal static class DefaultTimeSeriesOperators {
|
---|
32 | internal static IOperator CreateFunctionLibraryInjector() {
|
---|
33 | CombinedOperator op = new CombinedOperator();
|
---|
34 | op.Name = "FunctionLibraryInjector";
|
---|
35 | SequentialProcessor seq = new SequentialProcessor();
|
---|
36 | FunctionLibraryInjector funLibInjector = new FunctionLibraryInjector();
|
---|
37 | funLibInjector.GetVariable("Differentials").Value = new BoolData(true);
|
---|
38 | seq.AddSubOperator(funLibInjector);
|
---|
39 | seq.AddSubOperator(new HL3TreeEvaluatorInjector());
|
---|
40 | op.OperatorGraph.AddOperator(seq);
|
---|
41 | op.OperatorGraph.InitialOperator = seq;
|
---|
42 | return op;
|
---|
43 | }
|
---|
44 |
|
---|
45 | internal static IOperator CreateProblemInjector() {
|
---|
46 | CombinedOperator op = new CombinedOperator();
|
---|
47 | op.Name = "ProblemInjector";
|
---|
48 | SequentialProcessor seq = new SequentialProcessor();
|
---|
49 | seq.AddSubOperator(new ProblemInjector());
|
---|
50 | op.OperatorGraph.AddOperator(seq);
|
---|
51 | op.OperatorGraph.InitialOperator = seq;
|
---|
52 | return op;
|
---|
53 | }
|
---|
54 |
|
---|
55 | internal static IOperator CreatePostProcessingOperator() {
|
---|
56 | SequentialProcessor seq = new SequentialProcessor();
|
---|
57 | seq.AddSubOperator(DefaultStructureIdentificationAlgorithmOperators.CreatePostProcessingOperator());
|
---|
58 |
|
---|
59 | UniformSequentialSubScopesProcessor subScopesProc = new UniformSequentialSubScopesProcessor();
|
---|
60 | SequentialProcessor individualProc = new SequentialProcessor();
|
---|
61 | subScopesProc.AddSubOperator(individualProc);
|
---|
62 | seq.AddSubOperator(subScopesProc);
|
---|
63 |
|
---|
64 | SimpleTheilInequalityCoefficientEvaluator trainingTheil = new SimpleTheilInequalityCoefficientEvaluator();
|
---|
65 | trainingTheil.Name = "TrainingTheilInequalityEvaluator";
|
---|
66 | trainingTheil.GetVariableInfo("Values").ActualName = "TrainingValues";
|
---|
67 | trainingTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = "TrainingTheilInequalityCoefficient";
|
---|
68 | SimpleTheilInequalityCoefficientEvaluator validationTheil = new SimpleTheilInequalityCoefficientEvaluator();
|
---|
69 | validationTheil.Name = "ValidationTheilInequalityEvaluator";
|
---|
70 | validationTheil.GetVariableInfo("Values").ActualName = "ValidationValues";
|
---|
71 | validationTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = "ValidationTheilInequalityCoefficient";
|
---|
72 | SimpleTheilInequalityCoefficientEvaluator testTheil = new SimpleTheilInequalityCoefficientEvaluator();
|
---|
73 | testTheil.Name = "TestTheilInequalityEvaluator";
|
---|
74 | testTheil.GetVariableInfo("Values").ActualName = "TestValues";
|
---|
75 | testTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = "TestTheilInequalityCoefficient";
|
---|
76 |
|
---|
77 | individualProc.AddSubOperator(trainingTheil);
|
---|
78 | individualProc.AddSubOperator(validationTheil);
|
---|
79 | individualProc.AddSubOperator(testTheil);
|
---|
80 | return seq;
|
---|
81 | }
|
---|
82 |
|
---|
83 | internal static void SetModelData(IAnalyzerModel model, IScope scope) {
|
---|
84 | model.SetResult("TrainingTheilInequalityCoefficient", scope.GetVariableValue<DoubleData>("TrainingTheilInequalityCoefficient", true).Data);
|
---|
85 | model.SetResult("ValidationTheilInequalityCoefficient", scope.GetVariableValue<DoubleData>("ValidationTheilInequalityCoefficient", true).Data);
|
---|
86 | model.SetResult("TestTheilInequalityCoefficient", scope.GetVariableValue<DoubleData>("TestTheilInequalityCoefficient", true).Data);
|
---|
87 | }
|
---|
88 | }
|
---|
89 | }
|
---|