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.Operators;
|
---|
25 | using HeuristicLab.Modeling;
|
---|
26 | using HeuristicLab.Data;
|
---|
27 |
|
---|
28 | namespace HeuristicLab.Modeling {
|
---|
29 | public static class DefaultTimeSeriesOperators {
|
---|
30 | public static IOperator CreateProblemInjector() {
|
---|
31 | CombinedOperator op = new CombinedOperator();
|
---|
32 | op.Name = "ProblemInjector";
|
---|
33 | SequentialProcessor seq = new SequentialProcessor();
|
---|
34 | seq.AddSubOperator(new ProblemInjector());
|
---|
35 | op.OperatorGraph.AddOperator(seq);
|
---|
36 | op.OperatorGraph.InitialOperator = seq;
|
---|
37 | return op;
|
---|
38 | }
|
---|
39 |
|
---|
40 | public static IOperator CreatePostProcessingOperator() {
|
---|
41 | CombinedOperator op = new CombinedOperator();
|
---|
42 | op.Name = "Time series prognosis model analyzer";
|
---|
43 |
|
---|
44 | SequentialProcessor seq = new SequentialProcessor();
|
---|
45 | seq.AddSubOperator(DefaultRegressionOperators.CreatePostProcessingOperator());
|
---|
46 |
|
---|
47 | #region theil inequality
|
---|
48 | SimpleTheilInequalityCoefficientEvaluator trainingTheil = new SimpleTheilInequalityCoefficientEvaluator();
|
---|
49 | trainingTheil.Name = "TrainingTheilInequalityEvaluator";
|
---|
50 | trainingTheil.GetVariableInfo("Values").ActualName = "TrainingValues";
|
---|
51 | trainingTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = ModelingResult.TrainingTheilInequality.ToString();
|
---|
52 | SimpleTheilInequalityCoefficientEvaluator validationTheil = new SimpleTheilInequalityCoefficientEvaluator();
|
---|
53 | validationTheil.Name = "ValidationTheilInequalityEvaluator";
|
---|
54 | validationTheil.GetVariableInfo("Values").ActualName = "ValidationValues";
|
---|
55 | validationTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = ModelingResult.ValidationTheilInequality.ToString();
|
---|
56 | SimpleTheilInequalityCoefficientEvaluator testTheil = new SimpleTheilInequalityCoefficientEvaluator();
|
---|
57 | testTheil.Name = "TestTheilInequalityEvaluator";
|
---|
58 | testTheil.GetVariableInfo("Values").ActualName = "TestValues";
|
---|
59 | testTheil.GetVariableInfo("TheilInequalityCoefficient").ActualName = ModelingResult.TestTheilInequality.ToString();
|
---|
60 |
|
---|
61 | seq.AddSubOperator(trainingTheil);
|
---|
62 | seq.AddSubOperator(validationTheil);
|
---|
63 | seq.AddSubOperator(testTheil);
|
---|
64 | #endregion
|
---|
65 |
|
---|
66 | #region directional symmetry
|
---|
67 | SimpleDirectionalSymmetryEvaluator trainingDS = new SimpleDirectionalSymmetryEvaluator();
|
---|
68 | trainingDS.Name = "TrainingDirectionalSymmetryEvaluator";
|
---|
69 | trainingDS.GetVariableInfo("Values").ActualName = "TrainingValues";
|
---|
70 | trainingDS.GetVariableInfo("DirectionalSymmetry").ActualName = ModelingResult.TrainingDirectionalSymmetry.ToString();
|
---|
71 | SimpleDirectionalSymmetryEvaluator validationDS = new SimpleDirectionalSymmetryEvaluator();
|
---|
72 | validationDS.Name = "ValidationDirectionalSymmetryEvaluator";
|
---|
73 | validationDS.GetVariableInfo("Values").ActualName = "ValidationValues";
|
---|
74 | validationDS.GetVariableInfo("DirectionalSymmetry").ActualName = ModelingResult.ValidationDirectionalSymmetry.ToString();
|
---|
75 | SimpleDirectionalSymmetryEvaluator testDS = new SimpleDirectionalSymmetryEvaluator();
|
---|
76 | testDS.Name = "TestDirectionalSymmetryEvaluator";
|
---|
77 | testDS.GetVariableInfo("Values").ActualName = "TestValues";
|
---|
78 | testDS.GetVariableInfo("DirectionalSymmetry").ActualName = ModelingResult.TestDirectionalSymmetry.ToString();
|
---|
79 |
|
---|
80 | seq.AddSubOperator(trainingDS);
|
---|
81 | seq.AddSubOperator(validationDS);
|
---|
82 | seq.AddSubOperator(testDS);
|
---|
83 | #endregion
|
---|
84 |
|
---|
85 | #region weighted directional symmetry
|
---|
86 | SimpleWeightedDirectionalSymmetryEvaluator trainingWDS = new SimpleWeightedDirectionalSymmetryEvaluator();
|
---|
87 | trainingWDS.Name = "TrainingWeightedDirectionalSymmetryEvaluator";
|
---|
88 | trainingWDS.GetVariableInfo("Values").ActualName = "TrainingValues";
|
---|
89 | trainingWDS.GetVariableInfo("WeightedDirectionalSymmetry").ActualName = ModelingResult.TrainingWeightedDirectionalSymmetry.ToString();
|
---|
90 | SimpleWeightedDirectionalSymmetryEvaluator validationWDS = new SimpleWeightedDirectionalSymmetryEvaluator();
|
---|
91 | validationWDS.Name = "ValidationWeightedDirectionalSymmetryEvaluator";
|
---|
92 | validationWDS.GetVariableInfo("Values").ActualName = "ValidationValues";
|
---|
93 | validationWDS.GetVariableInfo("WeightedDirectionalSymmetry").ActualName = ModelingResult.ValidationWeightedDirectionalSymmetry.ToString();
|
---|
94 | SimpleWeightedDirectionalSymmetryEvaluator testWDS = new SimpleWeightedDirectionalSymmetryEvaluator();
|
---|
95 | testWDS.Name = "TestWeightedDirectionalSymmetryEvaluator";
|
---|
96 | testWDS.GetVariableInfo("Values").ActualName = "TestValues";
|
---|
97 | testWDS.GetVariableInfo("WeightedDirectionalSymmetry").ActualName = ModelingResult.TestWeightedDirectionalSymmetry.ToString();
|
---|
98 |
|
---|
99 | seq.AddSubOperator(trainingWDS);
|
---|
100 | seq.AddSubOperator(validationWDS);
|
---|
101 | seq.AddSubOperator(testWDS);
|
---|
102 | #endregion
|
---|
103 |
|
---|
104 | op.OperatorGraph.AddOperator(seq);
|
---|
105 | op.OperatorGraph.InitialOperator = seq;
|
---|
106 | return op;
|
---|
107 | }
|
---|
108 |
|
---|
109 | public static IAnalyzerModel PopulateAnalyzerModel(IScope modelScope, IAnalyzerModel model) {
|
---|
110 | DefaultRegressionOperators.PopulateAnalyzerModel(modelScope, model);
|
---|
111 | model.ExtractResult(modelScope, ModelingResult.TrainingTheilInequality);
|
---|
112 | model.ExtractResult(modelScope, ModelingResult.ValidationTheilInequality);
|
---|
113 | model.ExtractResult(modelScope, ModelingResult.TestTheilInequality);
|
---|
114 | model.ExtractResult(modelScope, ModelingResult.TrainingDirectionalSymmetry);
|
---|
115 | model.ExtractResult(modelScope, ModelingResult.ValidationDirectionalSymmetry);
|
---|
116 | model.ExtractResult(modelScope, ModelingResult.TestDirectionalSymmetry);
|
---|
117 | model.ExtractResult(modelScope, ModelingResult.TrainingWeightedDirectionalSymmetry);
|
---|
118 | model.ExtractResult(modelScope, ModelingResult.ValidationWeightedDirectionalSymmetry);
|
---|
119 | model.ExtractResult(modelScope, ModelingResult.TestWeightedDirectionalSymmetry);
|
---|
120 | model.Type = ModelType.TimeSeriesPrognosis;
|
---|
121 | return model;
|
---|
122 | }
|
---|
123 | }
|
---|
124 | }
|
---|