1 | #region License Information
|
---|
2 | /* HeuristicLab
|
---|
3 | * Copyright (C) 2002-2010 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 System;
|
---|
23 | using System.Linq;
|
---|
24 | using HeuristicLab.Common;
|
---|
25 | using HeuristicLab.Core;
|
---|
26 | using HeuristicLab.Data;
|
---|
27 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
28 | using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
|
---|
29 | using HeuristicLab.Problems.DataAnalysis;
|
---|
30 | using HeuristicLab.Problems.DataAnalysis.Evaluators;
|
---|
31 | using HeuristicLab.Parameters;
|
---|
32 | using HeuristicLab.Optimization;
|
---|
33 | using HeuristicLab.Operators;
|
---|
34 | using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
|
---|
35 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
36 | using System.Collections.Generic;
|
---|
37 | using HeuristicLab.Problems.DataAnalysis.Regression;
|
---|
38 | using HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Symbolic.Interfaces;
|
---|
39 |
|
---|
40 | namespace HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Symbolic.Evaluators {
|
---|
41 | [Item("SymbolicTimeSeriesPrognosisNormalizedMseEvaluator", "")]
|
---|
42 | [StorableClass]
|
---|
43 | public class SymbolicTimeSeriesPrognosisNormalizedMseEvaluator : SymbolicTimeSeriesPrognosisEvaluator {
|
---|
44 |
|
---|
45 | [StorableConstructor]
|
---|
46 | protected SymbolicTimeSeriesPrognosisNormalizedMseEvaluator(bool deserializing) : base(deserializing) { }
|
---|
47 | protected SymbolicTimeSeriesPrognosisNormalizedMseEvaluator(SymbolicTimeSeriesPrognosisNormalizedMseEvaluator original, Cloner cloner)
|
---|
48 | : base(original, cloner) {
|
---|
49 | }
|
---|
50 | public SymbolicTimeSeriesPrognosisNormalizedMseEvaluator()
|
---|
51 | : base() {
|
---|
52 | }
|
---|
53 |
|
---|
54 | public override IDeepCloneable Clone(Cloner cloner) {
|
---|
55 | return new SymbolicTimeSeriesPrognosisNormalizedMseEvaluator(this, cloner);
|
---|
56 | }
|
---|
57 |
|
---|
58 | public override double Evaluate(SymbolicExpressionTree tree, MultiVariateDataAnalysisProblemData problemData, ISymbolicTimeSeriesExpressionInterpreter interpreter, IEnumerable<int> rows, int predictionHorizon, DoubleArray lowerEstimationLimit, DoubleArray upperEstimationLimit) {
|
---|
59 | return Calculate(tree, problemData, interpreter, rows, predictionHorizon, lowerEstimationLimit, upperEstimationLimit);
|
---|
60 | }
|
---|
61 |
|
---|
62 | public static double Calculate(SymbolicExpressionTree tree, MultiVariateDataAnalysisProblemData problemData,
|
---|
63 | ISymbolicTimeSeriesExpressionInterpreter interpreter,
|
---|
64 | IEnumerable<int> rows, int predictionHorizon, DoubleArray lowerEstimationLimit, DoubleArray upperEstimationLimit) {
|
---|
65 | double[] zeros = new double[problemData.TargetVariables.CheckedItems.Count()];
|
---|
66 | double[] ones = Enumerable.Repeat(1.0, zeros.Length).ToArray();
|
---|
67 | return SymbolicTimeSeriesPrognosisScaledNormalizedMseEvaluator.CalculateWithScaling(tree, problemData, interpreter, rows,
|
---|
68 | predictionHorizon, lowerEstimationLimit, upperEstimationLimit, ones, zeros);
|
---|
69 | }
|
---|
70 | }
|
---|
71 | }
|
---|