Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataAnalysis/HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis/3.3/Symbolic/Evaluators/SymbolicTimeSeriesPrognosisNormalizedMseEvaluator.cs @ 5955

Last change on this file since 5955 was 5305, checked in by gkronber, 14 years ago

worked on data analysis feature exploration branch. #1142

File size: 3.5 KB
Line 
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
22using System;
23using System.Linq;
24using HeuristicLab.Common;
25using HeuristicLab.Core;
26using HeuristicLab.Data;
27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
28using HeuristicLab.Problems.DataAnalysis.SupportVectorMachine;
29using HeuristicLab.Problems.DataAnalysis;
30using HeuristicLab.Problems.DataAnalysis.Evaluators;
31using HeuristicLab.Parameters;
32using HeuristicLab.Optimization;
33using HeuristicLab.Operators;
34using HeuristicLab.Problems.DataAnalysis.Regression.Symbolic;
35using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
36using System.Collections.Generic;
37using HeuristicLab.Problems.DataAnalysis.Regression;
38using HeuristicLab.Problems.DataAnalysis.MultiVariate.TimeSeriesPrognosis.Symbolic.Interfaces;
39
40namespace 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}
Note: See TracBrowser for help on using the repository browser.