Changeset 7100


Ignore:
Timestamp:
11/29/11 20:05:38 (8 years ago)
Author:
gkronber
Message:

#1081 worked on multi-variate time series prognosis

Location:
branches/HeuristicLab.TimeSeries
Files:
3 added
18 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Algorithms.DataAnalysis/3.4/Linear/LinearTimeSeriesPrognosis.cs

    r7099 r7100  
    7676    #region linear regression
    7777    protected override void Run() {
    78       double rmsError, cvRmsError;
    79       var solution = CreateLinearTimeSeriesPrognosisSolution(Problem.ProblemData, MaximalLag, out rmsError, out cvRmsError);
     78      double[] rmsErrors, cvRmsErrors;
     79      var solution = CreateLinearTimeSeriesPrognosisSolution(Problem.ProblemData, MaximalLag, out rmsErrors, out cvRmsErrors);
    8080      Results.Add(new Result(LinearTimeSeriesPrognosisModelResultName, "The linear time-series prognosis solution.", solution));
    81       Results.Add(new Result("Root mean square error", "The root of the mean of squared errors of the linear time-series prognosis solution on the training set.", new DoubleValue(rmsError)));
    82       Results.Add(new Result("Estimated root mean square error (cross-validation)", "The estimated root of the mean of squared errors of the linear time-series prognosis solution via cross validation.", new DoubleValue(cvRmsError)));
     81      Results.Add(new Result("Root mean square errors", "The root of the mean of squared errors of the linear time-series prognosis solution on the training set.", new DoubleArray(rmsErrors)));
     82      Results.Add(new Result("Estimated root mean square errors (cross-validation)", "The estimated root of the mean of squared errors of the linear time-series prognosis solution via cross validation.", new DoubleArray(cvRmsErrors)));
    8383    }
    8484
    85     public static ISymbolicTimeSeriesPrognosisSolution CreateLinearTimeSeriesPrognosisSolution(ITimeSeriesPrognosisProblemData problemData, int maximalLag, out double rmsError, out double cvRmsError) {
     85    public static ISymbolicTimeSeriesPrognosisSolution CreateLinearTimeSeriesPrognosisSolution(ITimeSeriesPrognosisProblemData problemData, int maximalLag, out double[] rmsError, out double[] cvRmsError) {
    8686      Dataset dataset = problemData.Dataset;
    87       string targetVariable = problemData.TargetVariable;
    88       IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
    89       IEnumerable<int> rows = problemData.TrainingIndizes;
    90       IEnumerable<int> lags = Enumerable.Range(1, maximalLag);
    91       double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(dataset, allowedInputVariables.Concat(new string[] { targetVariable }), rows, lags);
    92       if (inputMatrix.Cast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))
    93         throw new NotSupportedException("Linear time-series prognosis does not support NaN or infinity values in the input dataset.");
     87      string[] targetVariables = problemData.TargetVariables.ToArray();
    9488
    95       alglib.linearmodel lm = new alglib.linearmodel();
    96       alglib.lrreport ar = new alglib.lrreport();
    97       int nRows = inputMatrix.GetLength(0);
    98       int nFeatures = inputMatrix.GetLength(1) - 1;
    99       double[] coefficients = new double[nFeatures + 1]; // last coefficient is for the constant
    100 
    101       int retVal = 1;
    102       alglib.lrbuild(inputMatrix, nRows, nFeatures, out retVal, out lm, out ar);
    103       if (retVal != 1) throw new ArgumentException("Error in calculation of linear time series prognosis solution");
    104       rmsError = ar.rmserror;
    105       cvRmsError = ar.cvrmserror;
    106 
    107       alglib.lrunpack(lm, out coefficients, out nFeatures);
    108 
     89      // prepare symbolic expression tree to hold the models for each target variable
    10990      ISymbolicExpressionTree tree = new SymbolicExpressionTree(new ProgramRootSymbol().CreateTreeNode());
    11091      ISymbolicExpressionTreeNode startNode = new StartSymbol().CreateTreeNode();
    11192      tree.Root.AddSubtree(startNode);
    112       ISymbolicExpressionTreeNode addition = new Addition().CreateTreeNode();
    113       startNode.AddSubtree(addition);
     93      int i = 0;
     94      rmsError = new double[targetVariables.Length];
     95      cvRmsError = new double[targetVariables.Length];
     96      foreach (var targetVariable in targetVariables) {
     97        IEnumerable<string> allowedInputVariables = problemData.AllowedInputVariables;
     98        IEnumerable<int> rows = problemData.TrainingIndizes;
     99        IEnumerable<int> lags = Enumerable.Range(1, maximalLag);
     100        double[,] inputMatrix = AlglibUtil.PrepareInputMatrix(dataset,
     101                                                              allowedInputVariables.Concat(new string[] { targetVariable }),
     102                                                              rows, lags);
     103        if (inputMatrix.Cast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))
     104          throw new NotSupportedException(
     105            "Linear time-series prognosis does not support NaN or infinity values in the input dataset.");
    114106
    115       int col = 0;
    116       foreach (string column in allowedInputVariables) {
    117         foreach (int lag in lags) {
    118           LaggedVariableTreeNode vNode =
    119             (LaggedVariableTreeNode)new HeuristicLab.Problems.DataAnalysis.Symbolic.LaggedVariable().CreateTreeNode();
    120           vNode.VariableName = column;
    121           vNode.Weight = coefficients[col];
    122           vNode.Lag = -lag;
    123           addition.AddSubtree(vNode);
    124           col++;
     107        alglib.linearmodel lm = new alglib.linearmodel();
     108        alglib.lrreport ar = new alglib.lrreport();
     109        int nRows = inputMatrix.GetLength(0);
     110        int nFeatures = inputMatrix.GetLength(1) - 1;
     111        double[] coefficients = new double[nFeatures + 1]; // last coefficient is for the constant
     112
     113        int retVal = 1;
     114        alglib.lrbuild(inputMatrix, nRows, nFeatures, out retVal, out lm, out ar);
     115        if (retVal != 1) throw new ArgumentException("Error in calculation of linear time series prognosis solution");
     116        rmsError[i] = ar.rmserror;
     117        cvRmsError[i] = ar.cvrmserror;
     118
     119        alglib.lrunpack(lm, out coefficients, out nFeatures);
     120
     121        ISymbolicExpressionTreeNode addition = new Addition().CreateTreeNode();
     122
     123        int col = 0;
     124        foreach (string column in allowedInputVariables) {
     125          foreach (int lag in lags) {
     126            LaggedVariableTreeNode vNode =
     127              (LaggedVariableTreeNode)new HeuristicLab.Problems.DataAnalysis.Symbolic.LaggedVariable().CreateTreeNode();
     128            vNode.VariableName = column;
     129            vNode.Weight = coefficients[col];
     130            vNode.Lag = -lag;
     131            addition.AddSubtree(vNode);
     132            col++;
     133          }
    125134        }
     135
     136        ConstantTreeNode cNode = (ConstantTreeNode)new Constant().CreateTreeNode();
     137        cNode.Value = coefficients[coefficients.Length - 1];
     138        addition.AddSubtree(cNode);
     139
     140        startNode.AddSubtree(addition);
     141        i++;
    126142      }
    127143
    128       ConstantTreeNode cNode = (ConstantTreeNode)new Constant().CreateTreeNode();
    129       cNode.Value = coefficients[coefficients.Length - 1];
    130       addition.AddSubtree(cNode);
    131 
    132       SymbolicTimeSeriesPrognosisSolution solution = new SymbolicTimeSeriesPrognosisSolution(new SymbolicTimeSeriesPrognosisModel(tree, new SymbolicDataAnalysisExpressionTreeInterpreter()), (ITimeSeriesPrognosisProblemData)problemData.Clone());
     144      SymbolicTimeSeriesPrognosisSolution solution = new SymbolicTimeSeriesPrognosisSolution(new SymbolicTimeSeriesPrognosisModel(tree, new SymbolicTimeSeriesPrognosisInterpreter(problemData.TargetVariables.ToArray())), (ITimeSeriesPrognosisProblemData)problemData.Clone());
    133145      solution.Model.Name = "Linear Time-Series Prognosis Model";
    134146      return solution;
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4

    • Property svn:ignore
      •  

        old new  
        33*.user
        44HeuristicLabProblemsDataAnalysisSymbolicTimeSeriesPrognosisViewsPlugin.cs
         5Plugin.cs
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4

    • Property svn:ignore
      •  

        old new  
        33HeuristicLabProblemsDataAnalysisSymbolicTimeSeriesPrognosisPlugin.cs
        44obj
         5Plugin.cs
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj

    r7099 r7100  
    110110  </ItemGroup>
    111111  <ItemGroup>
     112    <Compile Include="Interfaces\ISymbolicTimeSeriesPrognosisInterpreterOperator.cs" />
     113    <Compile Include="Interfaces\ISymbolicTimeSeriesPrognogisInterpreter.cs" />
    112114    <Compile Include="Interfaces\ISymbolicTimeSeriesPrognosisEvaluator.cs" />
    113115    <Compile Include="Interfaces\ISymbolicTimeSeriesPrognosisModel.cs" />
     
    117119    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveEvaluator.cs" />
    118120    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs" />
    119     <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveOverfittingAnalyzer.cs" />
    120121    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectivePearsonRSquaredEvaluator.cs" />
    121122    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs" />
    122123    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer.cs" />
    123     <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer.cs" />
     124    <Compile Include="SymbolicTimeSeriesPrognosisInterpreter.cs" />
    124125    <Compile Include="SymbolicTimeSeriesPrognosisModel.cs" />
    125126    <Compile Include="SymbolicTimeSeriesPrognosisSolution.cs" />
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs

    r6802 r7100  
    4848      IEnumerable<int> rows = GenerateRowsToEvaluate();
    4949
    50       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
     50      double quality = Calculate(SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
    5151      QualityParameter.ActualValue = new DoubleValue(quality);
    5252
     
    5656    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, ITimeSeriesPrognosisProblemData problemData, IEnumerable<int> rows) {
    5757      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    58       IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    59       IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit, upperEstimationLimit);
    60       OnlineCalculatorError errorState;
    61       double mse = OnlineMeanSquaredErrorCalculator.Calculate(originalValues, boundedEstimationValues, out errorState);
    62       if (errorState != OnlineCalculatorError.None) return double.NaN;
    63       else return mse;
     58      OnlineMeanAndVarianceCalculator meanCalculator = new OnlineMeanAndVarianceCalculator();
     59      foreach (var targetVariable in problemData.TargetVariables) {
     60        IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(targetVariable, rows);
     61        IEnumerable<double> boundedEstimationValues = estimatedValues.LimitToRange(lowerEstimationLimit,
     62                                                                                   upperEstimationLimit);
     63        OnlineCalculatorError errorState;
     64        meanCalculator.Add(OnlineMeanSquaredErrorCalculator.Calculate(originalValues, boundedEstimationValues, out errorState));
     65        if (errorState != OnlineCalculatorError.None) return double.NaN;
     66      }
     67      return meanCalculator.Mean;
    6468    }
    6569
    6670    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, ITimeSeriesPrognosisProblemData problemData, IEnumerable<int> rows) {
    67       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
     71      SymbolicTimeSeriesPrognosisInterpreterParameter.ExecutionContext = context;
    6872      EstimationLimitsParameter.ExecutionContext = context;
    6973
    70       double mse = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
     74      double mse = Calculate(SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
    7175
    7276
    73       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
     77      SymbolicTimeSeriesPrognosisInterpreterParameter.ExecutionContext = null;
    7478      EstimationLimitsParameter.ExecutionContext = null;
    7579
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectivePearsonRSquaredEvaluator.cs

    r6802 r7100  
    4848      IEnumerable<int> rows = GenerateRowsToEvaluate();
    4949
    50       double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
     50      double quality = Calculate(SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows);
    5151      QualityParameter.ActualValue = new DoubleValue(quality);
    5252
     
    5656    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter, ISymbolicExpressionTree solution, double lowerEstimationLimit, double upperEstimationLimit, ITimeSeriesPrognosisProblemData problemData, IEnumerable<int> rows) {
    5757      IEnumerable<double> estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    58       IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    59       OnlineCalculatorError errorState;
    60       double r2 = OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState);
    61       if (errorState != OnlineCalculatorError.None) return 0.0;
    62       else return r2;
     58      var meanCalculator = new OnlineMeanAndVarianceCalculator();
     59      foreach (var targetVariable in problemData.TargetVariables) {
     60        IEnumerable<double> originalValues = problemData.Dataset.GetDoubleValues(targetVariable, rows);
     61        OnlineCalculatorError errorState;
     62        meanCalculator.Add(OnlinePearsonsRSquaredCalculator.Calculate(estimatedValues, originalValues, out errorState));
     63        if (errorState != OnlineCalculatorError.None) return 0.0;
     64      }
     65      return meanCalculator.Mean;
    6366    }
    6467
    6568    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree, ITimeSeriesPrognosisProblemData problemData, IEnumerable<int> rows) {
    66       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
     69      SymbolicTimeSeriesPrognosisInterpreterParameter.ExecutionContext = context;
    6770      EstimationLimitsParameter.ExecutionContext = context;
    6871
    69       double r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
     72      double r2 = Calculate(SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue, tree, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, problemData, rows);
    7073
    71       SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
     74      SymbolicTimeSeriesPrognosisInterpreterParameter.ExecutionContext = null;
    7275      EstimationLimitsParameter.ExecutionContext = null;
    7376
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs

    r7099 r7100  
    6969      UpdateEstimationLimits();
    7070    }
    71    
     71
    7272    private void ConfigureGrammarSymbols() {
    7373      var grammar = SymbolicExpressionTreeGrammar as TypeCoherentExpressionGrammar;
     
    7777    private void InitializeOperators() {
    7878      Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer());
    79       Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer());
    80       Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveOverfittingAnalyzer());
     79      //Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer());
     80      //Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveOverfittingAnalyzer());
    8181      ParameterizeOperators();
    8282    }
    8383
    8484    private void UpdateEstimationLimits() {
    85       if (ProblemData.TrainingIndizes.Any()) {
    86         var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToList();
    87         var mean = targetValues.Average();
    88         var range = targetValues.Max() - targetValues.Min();
    89         EstimationLimits.Upper = mean + PunishmentFactor * range;
    90         EstimationLimits.Lower = mean - PunishmentFactor * range;
    91       } else {
    92         EstimationLimits.Upper = double.MaxValue;
    93         EstimationLimits.Lower = double.MinValue;
    94       }
     85      //if (ProblemData.TrainingIndizes.Any()) {
     86      //  var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariables, ProblemData.TrainingIndizes).ToList();
     87      //  var mean = targetValues.Average();
     88      //  var range = targetValues.Max() - targetValues.Min();
     89      //  EstimationLimits.Upper = mean + PunishmentFactor * range;
     90      //  EstimationLimits.Lower = mean - PunishmentFactor * range;
     91      //} else {
     92      EstimationLimits.Upper = double.MaxValue;
     93      EstimationLimits.Lower = double.MinValue;
     94      //}
    9595    }
    9696
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer.cs

    r6802 r7100  
    3434  [StorableClass]
    3535  public sealed class SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveTrainingBestSolutionAnalyzer<ISymbolicTimeSeriesPrognosisSolution>,
    36   ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator {
     36  ISymbolicTimeSeriesPrognosisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator {
    3737    private const string ProblemDataParameterName = "ProblemData";
    38     private const string SymbolicDataAnalysisTreeInterpreterParameterName = "SymbolicDataAnalysisTreeInterpreter";
     38    private const string SymbolicTimeSeriesPrognosisInterpreterParameterName = "SymbolicTimeSeriesPrognosisInterpreter";
    3939    private const string EstimationLimitsParameterName = "EstimationLimits";
    4040    private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
     
    4343      get { return (ILookupParameter<ITimeSeriesPrognosisProblemData>)Parameters[ProblemDataParameterName]; }
    4444    }
    45     public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> SymbolicDataAnalysisTreeInterpreterParameter {
    46       get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[SymbolicDataAnalysisTreeInterpreterParameterName]; }
     45    public ILookupParameter<ISymbolicTimeSeriesPrognosisInterpreter> SymbolicTimeSeriesPrognosisInterpreterParameter {
     46      get { return (ILookupParameter<ISymbolicTimeSeriesPrognosisInterpreter>)Parameters[SymbolicTimeSeriesPrognosisInterpreterParameterName]; }
    4747    }
    4848    public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
     
    6666      : base() {
    6767      Parameters.Add(new LookupParameter<ITimeSeriesPrognosisProblemData>(ProblemDataParameterName, "The problem data for the symbolic regression solution."));
    68       Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(SymbolicDataAnalysisTreeInterpreterParameterName, "The symbolic data analysis tree interpreter for the symbolic expression tree."));
     68      Parameters.Add(new LookupParameter<ISymbolicTimeSeriesPrognosisInterpreter>(SymbolicTimeSeriesPrognosisInterpreterParameterName, "The symbolic time series prognosis interpreter for the symbolic expression tree."));
    6969      Parameters.Add(new ValueLookupParameter<DoubleLimit>(EstimationLimitsParameterName, "The lower and upper limit for the estimated values produced by the symbolic regression model."));
    7070      Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic regression solution should be linearly scaled.", new BoolValue(true)));
     
    7575
    7676    protected override ISymbolicTimeSeriesPrognosisSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
    77       var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
     77      var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue);
    7878      if (ApplyLinearScaling.Value)
    7979        SymbolicTimeSeriesPrognosisModel.Scale(model, ProblemDataParameter.ActualValue);
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer.cs

    r6802 r7100  
    6767
    6868    protected override ISymbolicTimeSeriesPrognosisSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
    69       var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
     69      var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue);
    7070      if (ApplyLinearScaling.Value)
    7171        SymbolicTimeSeriesPrognosisModel.Scale(model, ProblemDataParameter.ActualValue);
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs

    r7099 r7100  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    3334  [Item(Name = "Symbolic Time-Series Prognosis Model", Description = "Represents a symbolic time series prognosis model.")]
    3435  public class SymbolicTimeSeriesPrognosisModel : SymbolicDataAnalysisModel, ISymbolicTimeSeriesPrognosisModel {
    35     [Storable]
    36     private double lowerEstimationLimit;
    37     [Storable]
    38     private double upperEstimationLimit;
     36    public new ISymbolicTimeSeriesPrognosisInterpreter Interpreter {
     37      get { return (ISymbolicTimeSeriesPrognosisInterpreter)base.Interpreter; }
     38    }
    3939
    4040    [StorableConstructor]
     
    4242    protected SymbolicTimeSeriesPrognosisModel(SymbolicTimeSeriesPrognosisModel original, Cloner cloner)
    4343      : base(original, cloner) {
    44       this.lowerEstimationLimit = original.lowerEstimationLimit;
    45       this.upperEstimationLimit = original.upperEstimationLimit;
    4644    }
    47     public SymbolicTimeSeriesPrognosisModel(ISymbolicExpressionTree tree, ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
    48       double lowerEstimationLimit = double.MinValue, double upperEstimationLimit = double.MaxValue)
     45    public SymbolicTimeSeriesPrognosisModel(ISymbolicExpressionTree tree, ISymbolicTimeSeriesPrognosisInterpreter interpreter)
    4946      : base(tree, interpreter) {
    50       this.lowerEstimationLimit = lowerEstimationLimit;
    51       this.upperEstimationLimit = upperEstimationLimit;
    5247    }
    5348
     
    5651    }
    5752
    58     public IEnumerable<double> GetPrognosedValues(Dataset dataset, IEnumerable<int> rows) {
    59       return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows)
    60         .LimitToRange(lowerEstimationLimit, upperEstimationLimit);
     53    public IEnumerable<IEnumerable<IEnumerable<double>>> GetPrognosedValues(Dataset dataset, IEnumerable<int> rows, int horizon) {
     54      return Interpreter.GetSymbolicExpressionTreeValues(SymbolicExpressionTree, dataset, rows, horizon);
    6155    }
    6256
     
    7064    public static void Scale(SymbolicTimeSeriesPrognosisModel model, ITimeSeriesPrognosisProblemData problemData) {
    7165      var dataset = problemData.Dataset;
    72       var targetVariable = problemData.TargetVariable;
     66      var targetVariables = problemData.TargetVariables;
    7367      var rows = problemData.TrainingIndizes;
    74       var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows);
    75       var targetValues = dataset.GetDoubleValues(targetVariable, rows);
    76       double alpha;
    77       double beta;
    78       OnlineCalculatorError errorState;
    79       OnlineLinearScalingParameterCalculator.Calculate(estimatedValues, targetValues, out alpha, out beta, out errorState);
    80       if (errorState != OnlineCalculatorError.None) return;
     68      int i = 0;
     69      int horizon = 1;
     70      var estimatedValues = model.Interpreter.GetSymbolicExpressionTreeValues(model.SymbolicExpressionTree, dataset, rows, horizon)
     71        .ToArray();
     72      foreach (var targetVariable in targetVariables) {
     73        var targetValues = dataset.GetDoubleValues(targetVariable, rows);
     74        double alpha;
     75        double beta;
     76        OnlineCalculatorError errorState;
     77        OnlineLinearScalingParameterCalculator.Calculate(estimatedValues[i].Select(x => x.First()), targetValues,
     78          out alpha, out beta, out errorState);
     79        if (errorState != OnlineCalculatorError.None) return;
    8180
    82       ConstantTreeNode alphaTreeNode = null;
    83       ConstantTreeNode betaTreeNode = null;
    84       // check if model has been scaled previously by analyzing the structure of the tree
    85       var startNode = model.SymbolicExpressionTree.Root.GetSubtree(0);
    86       if (startNode.GetSubtree(0).Symbol is Addition) {
    87         var addNode = startNode.GetSubtree(0);
    88         if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication && addNode.GetSubtree(1).Symbol is Constant) {
    89           alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
    90           var mulNode = addNode.GetSubtree(0);
    91           if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
    92             betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
     81        ConstantTreeNode alphaTreeNode = null;
     82        ConstantTreeNode betaTreeNode = null;
     83        // check if model has been scaled previously by analyzing the structure of the tree
     84        var startNode = model.SymbolicExpressionTree.Root.GetSubtree(0);
     85        if (startNode.GetSubtree(i).Symbol is Addition) {
     86          var addNode = startNode.GetSubtree(i);
     87          if (addNode.SubtreeCount == 2 && addNode.GetSubtree(0).Symbol is Multiplication &&
     88              addNode.GetSubtree(1).Symbol is Constant) {
     89            alphaTreeNode = addNode.GetSubtree(1) as ConstantTreeNode;
     90            var mulNode = addNode.GetSubtree(0);
     91            if (mulNode.SubtreeCount == 2 && mulNode.GetSubtree(1).Symbol is Constant) {
     92              betaTreeNode = mulNode.GetSubtree(1) as ConstantTreeNode;
     93            }
    9394          }
    9495        }
    95       }
    96       // if tree structure matches the structure necessary for linear scaling then reuse the existing tree nodes
    97       if (alphaTreeNode != null && betaTreeNode != null) {
    98         betaTreeNode.Value *= beta;
    99         alphaTreeNode.Value *= beta;
    100         alphaTreeNode.Value += alpha;
    101       } else {
    102         var mainBranch = startNode.GetSubtree(0);
    103         startNode.RemoveSubtree(0);
    104         var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha);
    105         startNode.AddSubtree(scaledMainBranch);
    106       }
     96        // if tree structure matches the structure necessary for linear scaling then reuse the existing tree nodes
     97        if (alphaTreeNode != null && betaTreeNode != null) {
     98          betaTreeNode.Value *= beta;
     99          alphaTreeNode.Value *= beta;
     100          alphaTreeNode.Value += alpha;
     101        } else {
     102          var mainBranch = startNode.GetSubtree(i);
     103          startNode.RemoveSubtree(i);
     104          var scaledMainBranch = MakeSum(MakeProduct(mainBranch, beta), alpha);
     105          startNode.InsertSubtree(i, scaledMainBranch);
     106        }
     107        i++;
     108      } // foreach
    107109    }
    108110
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r7099 r7100  
    128128      <DependentUpon>TimeSeriesPrognosisSolutionView.cs</DependentUpon>
    129129    </Compile>
    130     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs">
    131       <SubType>UserControl</SubType>
    132     </Compile>
    133     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.Designer.cs">
    134       <DependentUpon>TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs</DependentUpon>
    135     </Compile>
    136     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionLineChartView.cs">
    137       <SubType>UserControl</SubType>
    138     </Compile>
    139     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionLineChartView.Designer.cs">
    140       <DependentUpon>TimeSeriesPrognosisSolutionLineChartView.cs</DependentUpon>
    141     </Compile>
    142     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionPrognosedValuesView.cs">
    143       <SubType>UserControl</SubType>
    144     </Compile>
    145     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionPrognosedValuesView.Designer.cs">
    146       <DependentUpon>TimeSeriesPrognosisSolutionPrognosedValuesView.cs</DependentUpon>
    147     </Compile>
    148     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionScatterPlotView.cs">
    149       <SubType>UserControl</SubType>
    150     </Compile>
    151     <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionScatterPlotView.Designer.cs">
    152       <DependentUpon>TimeSeriesPrognosisSolutionScatterPlotView.cs</DependentUpon>
    153     </Compile>
    154130    <Compile Include="DataAnalysisSolutionEvaluationView.cs">
    155131      <SubType>UserControl</SubType>
     
    280256    <Compile Include="Regression\RegressionSolutionScatterPlotView.Designer.cs">
    281257      <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon>
     258    </Compile>
     259    <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionPrognosedValuesView.cs">
     260      <SubType>UserControl</SubType>
     261    </Compile>
     262    <Compile Include="TimeSeriesPrognosis\TimeSeriesPrognosisSolutionPrognosedValuesView.Designer.cs">
     263      <DependentUpon>TimeSeriesPrognosisSolutionPrognosedValuesView.cs</DependentUpon>
    282264    </Compile>
    283265    <None Include="HeuristicLab.snk" />
     
    396378    </BootstrapperPackage>
    397379  </ItemGroup>
     380  <ItemGroup />
    398381  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    399382  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.cs

    r6802 r7100  
    2020#endregion
    2121using System;
     22using System.Collections.Generic;
    2223using System.Linq;
    2324using System.Windows.Forms;
     
    3233  public partial class TimeSeriesPrognosisSolutionEstimatedValuesView : DataAnalysisSolutionEvaluationView {
    3334    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
    34     private const string PROGNOSEDVALUES_SERIES_NAME = "Prognosed Values (all)";
    3535    private const string PROGNOSEDVALUES_TRAINING_SERIES_NAME = "Prognosed Values (training)";
    3636    private const string PROGNOSEDVALUES_TEST_SERIES_NAME = "Prognosed Values (test)";
     
    8585      else {
    8686        StringMatrix matrix = null;
     87        List<string> columnNames = new List<string>();
    8788        if (Content != null) {
    88           string[,] values = new string[Content.ProblemData.Dataset.Rows, 7];
     89          columnNames.Add("Id");
    8990
    90           double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray();
    91           var prognosed = Content.PrognosedValues.GetEnumerator();
    92           var prognosed_training = Content.PrognosedTrainingValues.GetEnumerator();
    93           var prognosed_test = Content.PrognosedTestValues.GetEnumerator();
     91          string[,] values = new string[Content.ProblemData.Dataset.Rows, 1 + 3 * Content.ProblemData.TargetVariables.Count()];
     92          foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows))
     93            values[row, 0] = row.ToString();
    9494
    95           foreach (var row in Content.ProblemData.TrainingIndizes) {
    96             prognosed_training.MoveNext();
    97             values[row, 3] = prognosed_training.Current.ToString();
    98           }
     95          var prognosedTraining = Content.PrognosedTrainingValues.ToArray();
     96          var prognosedTest = Content.PrognosedTestValues.ToArray();
    9997
    100           foreach (var row in Content.ProblemData.TestIndizes) {
    101             prognosed_test.MoveNext();
    102             values[row, 4] = prognosed_test.Current.ToString();
    103           }
     98          int i = 0;
     99          int targetVariableIndex = 0;
     100          foreach (var targetVariable in Content.ProblemData.TargetVariables) {
     101            double[] target = Content.ProblemData.Dataset.GetDoubleValues(targetVariable).ToArray();
    104102
    105           foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows)) {
    106             prognosed.MoveNext();
    107             double est = prognosed.Current;
    108             double res = Math.Abs(est - target[row]);
    109             values[row, 0] = row.ToString();
    110             values[row, 1] = target[row].ToString();
    111             values[row, 2] = est.ToString();
    112             values[row, 5] = Math.Abs(res).ToString();
    113             values[row, 6] = Math.Abs(res / est).ToString();
    114           }
     103            var prognosedTrainingEnumerator = prognosedTraining[targetVariableIndex].GetEnumerator();
     104            foreach (var row in Content.ProblemData.TrainingIndizes) {
     105              prognosedTrainingEnumerator.MoveNext();
     106              values[row, i + 2] = prognosedTrainingEnumerator.Current.ToString();
     107            }
     108
     109            var prognosedTestEnumerator = prognosedTest[targetVariableIndex].GetEnumerator();
     110            foreach (var row in Content.ProblemData.TestIndizes) {
     111              prognosedTestEnumerator.MoveNext();
     112              values[row, i + 3] = prognosedTestEnumerator.Current.ToString();
     113            }
     114
     115            foreach (var row in Enumerable.Range(0, Content.ProblemData.Dataset.Rows)) {
     116              values[row, i + 1] = target[row].ToString();
     117            }
     118
     119            columnNames.AddRange(new string[] { targetVariable + "(actual)", targetVariable + "(training)", targetVariable + "(test)" });
     120            i += 3;
     121            targetVariableIndex++;
     122          } // foreach
     123
    115124
    116125          matrix = new StringMatrix(values);
    117           matrix.ColumnNames = new string[] { "Id", TARGETVARIABLE_SERIES_NAME, PROGNOSEDVALUES_SERIES_NAME, PROGNOSEDVALUES_TRAINING_SERIES_NAME, PROGNOSEDVALUES_TEST_SERIES_NAME, "Absolute Error (all)", "Relative Error (all)" };
     126          matrix.ColumnNames = columnNames.ToArray();
    118127          matrix.SortableView = true;
    119         }
     128
     129        } // if
    120130        matrixView.Content = matrix;
    121131      }
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisProblemData.cs

    r6802 r7100  
    3434  [Item("TimeSeriesPrognosisProblemData", "Represents an item containing all data defining a time series prognosis problem.")]
    3535  public class TimeSeriesPrognosisProblemData : DataAnalysisProblemData, ITimeSeriesPrognosisProblemData {
    36     protected const string TargetVariableParameterName = "TargetVariable";
     36    protected const string TargetVariablesParameterName = "TargetVariables";
    3737
    3838    #region default data
     
    15411541    private static readonly Dataset defaultDataset;
    15421542    private static readonly IEnumerable<string> defaultAllowedInputVariables;
    1543     private static readonly string defaultTargetVariable;
     1543    private static readonly string[] defaultTargetVariables;
    15441544
    15451545    private static readonly TimeSeriesPrognosisProblemData emptyProblemData;
     
    15521552      defaultDataset.Name = "Mackey-Glass (t=17) Time Series Benchmark Dataset";
    15531553      defaultAllowedInputVariables = new List<string>() { "x" };
    1554       defaultTargetVariable = "x";
     1554      defaultTargetVariables = new string[] { "x" };
    15551555
    15561556      var problemData = new TimeSeriesPrognosisProblemData();
     
    15641564      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
    15651565      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
    1566       problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
     1566      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariablesParameterName, new ItemSet<StringValue>()));
    15671567      emptyProblemData = problemData;
    15681568    }
    15691569    #endregion
    15701570
    1571     public ConstrainedValueParameter<StringValue> TargetVariableParameter {
    1572       get { return (ConstrainedValueParameter<StringValue>)Parameters[TargetVariableParameterName]; }
     1571    public ValueParameter<CheckedItemList<StringValue>> TargetVariablesParameter {
     1572      get { return (ValueParameter<CheckedItemList<StringValue>>)Parameters[TargetVariablesParameterName]; }
    15731573    }
    1574     public string TargetVariable {
    1575       get { return TargetVariableParameter.Value.Value; }
     1574    public IEnumerable<string> TargetVariables {
     1575      get { return TargetVariablesParameter.Value.CheckedItems.Select(x => x.Value.Value); }
    15761576    }
    15771577
     
    15931593
    15941594    public TimeSeriesPrognosisProblemData()
    1595       : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariable) {
     1595      : this(defaultDataset, defaultAllowedInputVariables, defaultTargetVariables) {
    15961596    }
    15971597
    1598     public TimeSeriesPrognosisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, string targetVariable)
     1598    public TimeSeriesPrognosisProblemData(Dataset dataset, IEnumerable<string> allowedInputVariables, IEnumerable<string> targetVariables)
    15991599      : base(dataset, allowedInputVariables) {
    16001600      var variables = InputVariables.Select(x => x.AsReadOnly()).ToList();
    1601       Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>(variables), variables.Where(x => x.Value == targetVariable).First()));
     1601      var targetVariablesList = new CheckedItemList<StringValue>(variables);
     1602      foreach (var targetVar in targetVariables) {
     1603        targetVariablesList.SetItemCheckedState(targetVariablesList.Single(x => x.Value == targetVar), true);
     1604      }
     1605      Parameters.Add(new FixedValueParameter<CheckedItemList<StringValue>>(TargetVariablesParameterName, targetVariablesList));
    16021606      RegisterParameterEvents();
    16031607    }
    16041608
    16051609    private void RegisterParameterEvents() {
    1606       TargetVariableParameter.ValueChanged += TargetVariableParameter_ValueChanged;
     1610      TargetVariablesParameter.Value.CheckedItemsChanged += TargetVariableParameter_ValueChanged;
    16071611    }
    16081612
     
    16191623      dataset.Name = Path.GetFileName(fileName);
    16201624
    1621       TimeSeriesPrognosisProblemData problemData = new TimeSeriesPrognosisProblemData(dataset, dataset.DoubleVariables, dataset.DoubleVariables.First());
     1625      TimeSeriesPrognosisProblemData problemData = new TimeSeriesPrognosisProblemData(dataset, dataset.DoubleVariables, dataset.DoubleVariables.Take(1));
    16221626      problemData.Name = "Data imported from " + Path.GetFileName(fileName);
    16231627      return problemData;
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolution.cs

    r6802 r7100  
    4747    }
    4848
    49     public override IEnumerable<double> PrognosedValues {
    50       get { return GetPrognosedValues(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
     49    public override IEnumerable<IEnumerable<double>> PrognosedTrainingValues {
     50      get {
     51        return GetPrognosedValues(Enumerable.Range(ProblemData.TrainingPartition.Start, 1),
     52          ProblemData.TrainingPartition.End - ProblemData.TrainingPartition.Start)
     53          .First();
     54      }
    5155    }
    52     public override IEnumerable<double> PrognosedTrainingValues {
    53       get { return GetPrognosedValues(ProblemData.TrainingIndizes); }
     56    public override IEnumerable<IEnumerable<double>> PrognosedTestValues {
     57      get {
     58        return GetPrognosedValues(Enumerable.Range(ProblemData.TestPartition.Start, 1),
     59          ProblemData.TestPartition.End - ProblemData.TestPartition.Start)
     60          .First();
     61      }
    5462    }
    55     public override IEnumerable<double> PrognosedTestValues {
    56       get { return GetPrognosedValues(ProblemData.TestIndizes); }
    57     }
    58     public override IEnumerable<double> GetPrognosedValues(IEnumerable<int> rows) {
    59       return Model.GetPrognosedValues(ProblemData.Dataset, rows);
     63    public override IEnumerable<IEnumerable<IEnumerable<double>>> GetPrognosedValues(IEnumerable<int> rows, int horizon) {
     64      return Model.GetPrognosedValues(ProblemData.Dataset, rows, horizon);
    6065    }
    6166
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs

    r7099 r7100  
    2020#endregion
    2121
     22using System.Collections.Concurrent;
    2223using System.Collections.Generic;
    2324using System.Linq;
     
    5758    }
    5859
    59     public abstract IEnumerable<double> PrognosedValues { get; }
    60     public abstract IEnumerable<double> PrognosedTrainingValues { get; }
    61     public abstract IEnumerable<double> PrognosedTestValues { get; }
    62     public abstract IEnumerable<double> GetPrognosedValues(IEnumerable<int> rows);
     60    public abstract IEnumerable<IEnumerable<double>> PrognosedTrainingValues { get; }
     61    public abstract IEnumerable<IEnumerable<double>> PrognosedTestValues { get; }
     62    public abstract IEnumerable<IEnumerable<IEnumerable<double>>> GetPrognosedValues(IEnumerable<int> rows, int horizon);
    6363
    6464    #region Results
    65     public double TrainingMeanSquaredError {
    66       get { return ((DoubleValue)this[TrainingMeanSquaredErrorResultName].Value).Value; }
    67       private set { ((DoubleValue)this[TrainingMeanSquaredErrorResultName].Value).Value = value; }
    68     }
    69     public double TestMeanSquaredError {
    70       get { return ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value; }
    71       private set { ((DoubleValue)this[TestMeanSquaredErrorResultName].Value).Value = value; }
    72     }
    73     public double TrainingMeanAbsoluteError {
    74       get { return ((DoubleValue)this[TrainingMeanAbsoluteErrorResultName].Value).Value; }
    75       private set { ((DoubleValue)this[TrainingMeanAbsoluteErrorResultName].Value).Value = value; }
    76     }
    77     public double TestMeanAbsoluteError {
    78       get { return ((DoubleValue)this[TestMeanAbsoluteErrorResultName].Value).Value; }
    79       private set { ((DoubleValue)this[TestMeanAbsoluteErrorResultName].Value).Value = value; }
    80     }
    81     public double TrainingRSquared {
    82       get { return ((DoubleValue)this[TrainingSquaredCorrelationResultName].Value).Value; }
    83       private set { ((DoubleValue)this[TrainingSquaredCorrelationResultName].Value).Value = value; }
    84     }
    85     public double TestRSquared {
    86       get { return ((DoubleValue)this[TestSquaredCorrelationResultName].Value).Value; }
    87       private set { ((DoubleValue)this[TestSquaredCorrelationResultName].Value).Value = value; }
    88     }
    89     public double TrainingRelativeError {
    90       get { return ((DoubleValue)this[TrainingRelativeErrorResultName].Value).Value; }
    91       private set { ((DoubleValue)this[TrainingRelativeErrorResultName].Value).Value = value; }
    92     }
    93     public double TestRelativeError {
    94       get { return ((DoubleValue)this[TestRelativeErrorResultName].Value).Value; }
    95       private set { ((DoubleValue)this[TestRelativeErrorResultName].Value).Value = value; }
    96     }
    97     public double TrainingNormalizedMeanSquaredError {
    98       get { return ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value; }
    99       private set { ((DoubleValue)this[TrainingNormalizedMeanSquaredErrorResultName].Value).Value = value; }
    100     }
    101     public double TestNormalizedMeanSquaredError {
    102       get { return ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value; }
    103       private set { ((DoubleValue)this[TestNormalizedMeanSquaredErrorResultName].Value).Value = value; }
    104     }
    105     public double TrainingDirectionalSymmetry {
    106       get { return ((DoubleValue)this[TrainingDirectionalSymmetryResultName].Value).Value; }
    107       private set { ((DoubleValue)this[TrainingDirectionalSymmetryResultName].Value).Value = value; }
    108     }
    109     public double TestDirectionalSymmetry {
    110       get { return ((DoubleValue)this[TestDirectionalSymmetryResultName].Value).Value; }
    111       private set { ((DoubleValue)this[TestDirectionalSymmetryResultName].Value).Value = value; }
    112     }
    113     public double TrainingWeightedDirectionalSymmetry {
    114       get { return ((DoubleValue)this[TrainingWeightedDirectionalSymmetryResultName].Value).Value; }
    115       private set { ((DoubleValue)this[TrainingWeightedDirectionalSymmetryResultName].Value).Value = value; }
    116     }
    117     public double TestWeightedDirectionalSymmetry {
    118       get { return ((DoubleValue)this[TestWeightedDirectionalSymmetryResultName].Value).Value; }
    119       private set { ((DoubleValue)this[TestWeightedDirectionalSymmetryResultName].Value).Value = value; }
    120     }
    121     public double TrainingTheilsUStatistic {
    122       get { return ((DoubleValue)this[TrainingTheilsUStatisticResultName].Value).Value; }
    123       private set { ((DoubleValue)this[TrainingTheilsUStatisticResultName].Value).Value = value; }
    124     }
    125     public double TestTheilsUStatistic {
    126       get { return ((DoubleValue)this[TestTheilsUStatisticResultName].Value).Value; }
    127       private set { ((DoubleValue)this[TestTheilsUStatisticResultName].Value).Value = value; }
     65    public double[] TrainingMeanSquaredError {
     66      get { return ((DoubleArray)this[TrainingMeanSquaredErrorResultName].Value).ToArray(); }
     67      private set { this[TrainingMeanSquaredErrorResultName].Value = new DoubleArray(value); }
     68    }
     69    public double[] TestMeanSquaredError {
     70      get { return ((DoubleArray)this[TestMeanSquaredErrorResultName].Value).ToArray(); }
     71      private set { this[TestMeanSquaredErrorResultName].Value = new DoubleArray(value); }
     72    }
     73    public double[] TrainingMeanAbsoluteError {
     74      get { return ((DoubleArray)this[TrainingMeanAbsoluteErrorResultName].Value).ToArray(); }
     75      private set { this[TrainingMeanAbsoluteErrorResultName].Value = new DoubleArray(value); }
     76    }
     77    public double[] TestMeanAbsoluteError {
     78      get { return ((DoubleArray)this[TestMeanAbsoluteErrorResultName].Value).ToArray(); }
     79      private set { this[TestMeanAbsoluteErrorResultName].Value = new DoubleArray(value); }
     80    }
     81    public double[] TrainingRSquared {
     82      get { return ((DoubleArray)this[TrainingSquaredCorrelationResultName].Value).ToArray(); }
     83      private set { this[TrainingSquaredCorrelationResultName].Value = new DoubleArray(value); }
     84    }
     85    public double[] TestRSquared {
     86      get { return ((DoubleArray)this[TestSquaredCorrelationResultName].Value).ToArray(); }
     87      private set { this[TestSquaredCorrelationResultName].Value = new DoubleArray(value); }
     88    }
     89    public double[] TrainingRelativeError {
     90      get { return ((DoubleArray)this[TrainingRelativeErrorResultName].Value).ToArray(); }
     91      private set { this[TrainingRelativeErrorResultName].Value = new DoubleArray(value); }
     92    }
     93    public double[] TestRelativeError {
     94      get { return ((DoubleArray)this[TestRelativeErrorResultName].Value).ToArray(); }
     95      private set { this[TestRelativeErrorResultName].Value = new DoubleArray(value); }
     96    }
     97    public double[] TrainingNormalizedMeanSquaredError {
     98      get { return ((DoubleArray)this[TrainingNormalizedMeanSquaredErrorResultName].Value).ToArray(); }
     99      private set { this[TrainingNormalizedMeanSquaredErrorResultName].Value = new DoubleArray(value); }
     100    }
     101    public double[] TestNormalizedMeanSquaredError {
     102      get { return ((DoubleArray)this[TestNormalizedMeanSquaredErrorResultName].Value).ToArray(); }
     103      private set { this[TestNormalizedMeanSquaredErrorResultName].Value = new DoubleArray(value); }
     104    }
     105    public double[] TrainingDirectionalSymmetry {
     106      get { return ((DoubleArray)this[TrainingDirectionalSymmetryResultName].Value).ToArray(); }
     107      private set { this[TrainingDirectionalSymmetryResultName].Value = new DoubleArray(value); }
     108    }
     109    public double[] TestDirectionalSymmetry {
     110      get { return ((DoubleArray)this[TestDirectionalSymmetryResultName].Value).ToArray(); }
     111      private set { this[TestDirectionalSymmetryResultName].Value = new DoubleArray(value); }
     112    }
     113    public double[] TrainingWeightedDirectionalSymmetry {
     114      get { return ((DoubleArray)this[TrainingWeightedDirectionalSymmetryResultName].Value).ToArray(); }
     115      private set { this[TrainingWeightedDirectionalSymmetryResultName].Value = new DoubleArray(value); }
     116    }
     117    public double[] TestWeightedDirectionalSymmetry {
     118      get { return ((DoubleArray)this[TestWeightedDirectionalSymmetryResultName].Value).ToArray(); }
     119      private set { this[TestWeightedDirectionalSymmetryResultName].Value = new DoubleArray(value); }
     120    }
     121    public double[] TrainingTheilsUStatistic {
     122      get { return ((DoubleArray)this[TrainingTheilsUStatisticResultName].Value).ToArray(); }
     123      private set { this[TrainingTheilsUStatisticResultName].Value = new DoubleArray(value); }
     124    }
     125    public double[] TestTheilsUStatistic {
     126      get { return ((DoubleArray)this[TestTheilsUStatisticResultName].Value).ToArray(); }
     127      private set { this[TestTheilsUStatisticResultName].Value = new DoubleArray(value); }
    128128    }
    129129    #endregion
     
    136136    protected TimeSeriesPrognosisSolutionBase(ITimeSeriesPrognosisModel model, ITimeSeriesPrognosisProblemData problemData)
    137137      : base(model, problemData) {
    138       Add(new Result(TrainingMeanSquaredErrorResultName, "Mean of squared errors of the model on the training partition", new DoubleValue()));
    139       Add(new Result(TestMeanSquaredErrorResultName, "Mean of squared errors of the model on the test partition", new DoubleValue()));
    140       Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleValue()));
    141       Add(new Result(TestMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the test partition", new DoubleValue()));
    142       Add(new Result(TrainingSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the training partition", new DoubleValue()));
    143       Add(new Result(TestSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the test partition", new DoubleValue()));
    144       Add(new Result(TrainingRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the training partition", new PercentValue()));
    145       Add(new Result(TestRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the test partition", new PercentValue()));
    146       Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the training partition", new DoubleValue()));
    147       Add(new Result(TestNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the test partition", new DoubleValue()));
    148       Add(new Result(TrainingDirectionalSymmetryResultName, "The average directional symmetry of the forecasts of the model on the training partition", new PercentValue()));
    149       Add(new Result(TestDirectionalSymmetryResultName, "The average directional symmetry of the forecasts of the model on the test partition", new PercentValue()));
    150       Add(new Result(TrainingWeightedDirectionalSymmetryResultName, "The average weighted directional symmetry of the forecasts of the model on the training partition", new DoubleValue()));
    151       Add(new Result(TestWeightedDirectionalSymmetryResultName, "The average weighted directional symmetry of the forecasts of the model on the test partition", new DoubleValue()));
    152       Add(new Result(TrainingTheilsUStatisticResultName, "The average Theil's U statistic of the forecasts of the model on the training partition", new DoubleValue()));
    153       Add(new Result(TestTheilsUStatisticResultName, "The average Theil's U statistic of the forecasts of the model on the test partition", new DoubleValue()));
     138      Add(new Result(TrainingMeanSquaredErrorResultName, "Mean of squared errors of the model on the training partition", new DoubleArray()));
     139      Add(new Result(TestMeanSquaredErrorResultName, "Mean of squared errors of the model on the test partition", new DoubleArray()));
     140      Add(new Result(TrainingMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the training partition", new DoubleArray()));
     141      Add(new Result(TestMeanAbsoluteErrorResultName, "Mean of absolute errors of the model on the test partition", new DoubleArray()));
     142      Add(new Result(TrainingSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the training partition", new DoubleArray()));
     143      Add(new Result(TestSquaredCorrelationResultName, "Squared Pearson's correlation coefficient of the model output and the actual values on the test partition", new DoubleArray()));
     144      Add(new Result(TrainingRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the training partition", new DoubleArray()));
     145      Add(new Result(TestRelativeErrorResultName, "Average of the relative errors of the model output and the actual values on the test partition", new DoubleArray()));
     146      Add(new Result(TrainingNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the training partition", new DoubleArray()));
     147      Add(new Result(TestNormalizedMeanSquaredErrorResultName, "Normalized mean of squared errors of the model on the test partition", new DoubleArray()));
     148      Add(new Result(TrainingDirectionalSymmetryResultName, "The average directional symmetry of the forecasts of the model on the training partition", new DoubleArray()));
     149      Add(new Result(TestDirectionalSymmetryResultName, "The average directional symmetry of the forecasts of the model on the test partition", new DoubleArray()));
     150      Add(new Result(TrainingWeightedDirectionalSymmetryResultName, "The average weighted directional symmetry of the forecasts of the model on the training partition", new DoubleArray()));
     151      Add(new Result(TestWeightedDirectionalSymmetryResultName, "The average weighted directional symmetry of the forecasts of the model on the test partition", new DoubleArray()));
     152      Add(new Result(TrainingTheilsUStatisticResultName, "The average Theil's U statistic of the forecasts of the model on the training partition", new DoubleArray()));
     153      Add(new Result(TestTheilsUStatisticResultName, "The average Theil's U statistic of the forecasts of the model on the test partition", new DoubleArray()));
    154154    }
    155155
     
    160160
    161161    protected void CalculateResults() {
     162      OnlineCalculatorError errorState;
     163      /*
    162164      double[] estimatedTrainingValues = PrognosedTrainingValues.ToArray(); // cache values
    163165      double[] originalTrainingValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).ToArray();
     
    165167      double[] originalTestValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndizes).ToArray();
    166168
    167       OnlineCalculatorError errorState;
    168169      double trainingMse = OnlineMeanSquaredErrorCalculator.Calculate(originalTrainingValues, estimatedTrainingValues, out errorState);
    169170      TrainingMeanSquaredError = errorState == OnlineCalculatorError.None ? trainingMse : double.NaN;
     
    190191      double testNmse = OnlineNormalizedMeanSquaredErrorCalculator.Calculate(originalTestValues, estimatedTestValues, out errorState);
    191192      TestNormalizedMeanSquaredError = errorState == OnlineCalculatorError.None ? testNmse : double.NaN;
    192 
    193       var startTrainingValues = originalTrainingValues;
    194       // each continuation is only one element long
    195       var actualContinuationsTraining = from x in originalTrainingValues.Skip(1)
    196                                         select Enumerable.Repeat(x, 1);
    197       // each forecast is only one elemnt long
    198       // disregards the first estimated value (we could include this again by extending the list of original values by one step to the left
    199       // this is the easier way
    200       var predictedContinuationsTraining = from x in estimatedTrainingValues.Skip(1)
    201                                            select Enumerable.Repeat(x, 1);
    202 
    203       var startTestValues = originalTestValues;
    204       var actualContinuationsTest = from x in originalTestValues.Skip(1)
    205                                     select Enumerable.Repeat(x, 1);
    206       var predictedContinuationsTest = from x in estimatedTestValues.Skip(1)
    207                                        select Enumerable.Repeat(x, 1);
    208 
    209       double trainingDirectionalSymmetry = OnlineDirectionalSymmetryCalculator.Calculate(startTrainingValues, actualContinuationsTraining, predictedContinuationsTraining, out errorState);
    210       TrainingDirectionalSymmetry = errorState == OnlineCalculatorError.None ? trainingDirectionalSymmetry : double.NaN;
    211       double testDirectionalSymmetry = OnlineDirectionalSymmetryCalculator.Calculate(startTestValues, actualContinuationsTest, predictedContinuationsTest, out errorState);
    212       TestDirectionalSymmetry = errorState == OnlineCalculatorError.None ? testDirectionalSymmetry : double.NaN;
    213 
    214       double trainingWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(startTrainingValues, actualContinuationsTraining, predictedContinuationsTraining, out errorState);
    215       TrainingWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? trainingWeightedDirectionalSymmetry : double.NaN;
    216       double testWeightedDirectionalSymmetry = OnlineWeightedDirectionalSymmetryCalculator.Calculate(startTestValues, actualContinuationsTest, predictedContinuationsTest, out errorState);
    217       TestWeightedDirectionalSymmetry = errorState == OnlineCalculatorError.None ? testWeightedDirectionalSymmetry : double.NaN;
    218 
    219       double trainingTheilsU = OnlineTheilsUStatisticCalculator.Calculate(startTrainingValues, actualContinuationsTraining, predictedContinuationsTraining, out errorState);
    220       TrainingTheilsUStatistic = errorState == OnlineCalculatorError.None ? trainingTheilsU : double.NaN;
    221       double testTheilsU = OnlineTheilsUStatisticCalculator.Calculate(startTestValues, actualContinuationsTest, predictedContinuationsTest, out errorState);
    222       TestTheilsUStatistic = errorState == OnlineCalculatorError.None ? testTheilsU : double.NaN;
     193              */
     194
     195      double[] trainingDs = new double[ProblemData.TargetVariables.Count()];
     196      double[] testDs = new double[ProblemData.TargetVariables.Count()];
     197
     198      double[] trainingWds = new double[ProblemData.TargetVariables.Count()];
     199      double[] testWds = new double[ProblemData.TargetVariables.Count()];
     200
     201      double[] trainingTheilsU = new double[ProblemData.TargetVariables.Count()];
     202      double[] testTheilsU = new double[ProblemData.TargetVariables.Count()];
     203      int i = 0;
     204      var predictedContinuationTraining = PrognosedTrainingValues.ToArray();
     205      var predictedContinuationTest = PrognosedTestValues.ToArray();
     206
     207      foreach (var targetVariable in ProblemData.TargetVariables) {
     208        var actualTrainingValues = ProblemData.Dataset.GetDoubleValues(targetVariable, ProblemData.TrainingIndizes).ToArray();
     209        var startTrainingValues = actualTrainingValues.Take(1);
     210        // only one continuation (but the full training set)
     211        var actualContinuationTraining = actualTrainingValues.Skip(1);
     212
     213        var actualTestValues = ProblemData.Dataset.GetDoubleValues(targetVariable, ProblemData.TestIndizes).ToArray();
     214        var startTestValues = actualTestValues.Take(1);
     215        // only one continuation (but the full training set)
     216        var actualContinuationTest = actualTestValues.Skip(1);
     217
     218
     219        trainingDs[i] = OnlineDirectionalSymmetryCalculator.Calculate(startTrainingValues,
     220          Enumerable.Repeat(actualContinuationTraining, 1),
     221          Enumerable.Repeat(predictedContinuationTraining[i], 1), out errorState);
     222        if (errorState != OnlineCalculatorError.None) trainingDs[i] = double.NaN;
     223
     224        testDs[i] = OnlineDirectionalSymmetryCalculator.Calculate(startTestValues,
     225          Enumerable.Repeat(actualContinuationTest, 1),
     226          Enumerable.Repeat(predictedContinuationTest[i], 1), out errorState);
     227        if (errorState != OnlineCalculatorError.None) testDs[i] = double.NaN;
     228
     229        trainingWds[i] =
     230          OnlineWeightedDirectionalSymmetryCalculator.Calculate(startTrainingValues,
     231          Enumerable.Repeat(actualContinuationTraining, 1),
     232          Enumerable.Repeat(predictedContinuationTraining[i], 1), out errorState);
     233        if (errorState != OnlineCalculatorError.None) trainingWds[i] = double.NaN;
     234
     235        testWds[i] = OnlineWeightedDirectionalSymmetryCalculator.Calculate(startTestValues,
     236          Enumerable.Repeat(actualContinuationTest, 1),
     237          Enumerable.Repeat(predictedContinuationTest[i], 1), out errorState);
     238        if (errorState != OnlineCalculatorError.None) testWds[i] = double.NaN;
     239
     240        trainingTheilsU[i] = OnlineTheilsUStatisticCalculator.Calculate(startTrainingValues,
     241          Enumerable.Repeat(actualContinuationTraining, 1),
     242          Enumerable.Repeat(predictedContinuationTraining[i], 1), out errorState);
     243        if (errorState != OnlineCalculatorError.None) trainingTheilsU[i] = double.NaN;
     244
     245        testTheilsU[i] = OnlineTheilsUStatisticCalculator.Calculate(startTestValues,
     246          Enumerable.Repeat(actualContinuationTest, 1),
     247          Enumerable.Repeat(predictedContinuationTest[i], 1), out errorState);
     248        if (errorState != OnlineCalculatorError.None) testTheilsU[i] = double.NaN;
     249        i++;
     250      }
     251
     252      TrainingDirectionalSymmetry = trainingDs;
     253      TestDirectionalSymmetry = testDs;
     254      TrainingWeightedDirectionalSymmetry = trainingWds;
     255      TestWeightedDirectionalSymmetry = testWds;
     256      TrainingTheilsUStatistic = trainingTheilsU;
     257      TestTheilsUStatistic = testTheilsU;
    223258    }
    224259  }
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/ITimeSeriesPrognosisModel.cs

    r6802 r7100  
    2323namespace HeuristicLab.Problems.DataAnalysis {
    2424  public interface ITimeSeriesPrognosisModel : IDataAnalysisModel {
    25     IEnumerable<double> GetPrognosedValues(Dataset dataset, IEnumerable<int> rows);
     25    IEnumerable<IEnumerable<IEnumerable<double>>> GetPrognosedValues(Dataset dataset, IEnumerable<int> rows, int horizon);
    2626    ITimeSeriesPrognosisSolution CreateTimeSeriesPrognosisSolution(ITimeSeriesPrognosisProblemData problemData);
    2727  }
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/ITimeSeriesPrognosisProblemData.cs

    r6802 r7100  
    2020#endregion
    2121
     22using System.Collections.Generic;
    2223namespace HeuristicLab.Problems.DataAnalysis {
    2324  public interface ITimeSeriesPrognosisProblemData : IDataAnalysisProblemData {
    24     string TargetVariable { get; }
     25    IEnumerable<string> TargetVariables { get; }
    2526  }
    2627}
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/TimeSeriesPrognosis/ITimeSeriesPrognosisSolution.cs

    r6802 r7100  
    2626    new ITimeSeriesPrognosisProblemData ProblemData { get; set; }
    2727
    28     IEnumerable<double> PrognosedTrainingValues { get; }
    29     IEnumerable<double> PrognosedTestValues { get; }
    30     IEnumerable<double> PrognosedValues { get; }
    31     IEnumerable<double> GetPrognosedValues(IEnumerable<int> rows);
     28    IEnumerable<IEnumerable<double>> PrognosedTrainingValues { get; }
     29    IEnumerable<IEnumerable<double>> PrognosedTestValues { get; }
     30    IEnumerable<IEnumerable<IEnumerable<double>>> GetPrognosedValues(IEnumerable<int> rows, int horizon);
    3231
    33     double TrainingMeanSquaredError { get; }
    34     double TestMeanSquaredError { get; }
    35     double TrainingMeanAbsoluteError { get; }
    36     double TestMeanAbsoluteError { get; }
    37     double TrainingRSquared { get; }
    38     double TestRSquared { get; }
    39     double TrainingRelativeError { get; }
    40     double TestRelativeError { get; }
    41     double TrainingNormalizedMeanSquaredError { get; }
    42     double TestNormalizedMeanSquaredError { get; }
    43     double TrainingTheilsUStatistic { get; }
    44     double TestTheilsUStatistic { get; }
    45     double TrainingDirectionalSymmetry { get; }
    46     double TestDirectionalSymmetry { get; }
    47     double TrainingWeightedDirectionalSymmetry { get; }
    48     double TestWeightedDirectionalSymmetry { get; }
    49   }                     
     32    double[] TrainingMeanSquaredError { get; }
     33    double[] TestMeanSquaredError { get; }
     34    double[] TrainingMeanAbsoluteError { get; }
     35    double[] TestMeanAbsoluteError { get; }
     36    double[] TrainingRSquared { get; }
     37    double[] TestRSquared { get; }
     38    double[] TrainingRelativeError { get; }
     39    double[] TestRelativeError { get; }
     40    double[] TrainingNormalizedMeanSquaredError { get; }
     41    double[] TestNormalizedMeanSquaredError { get; }
     42    double[] TrainingTheilsUStatistic { get; }
     43    double[] TestTheilsUStatistic { get; }
     44    double[] TrainingDirectionalSymmetry { get; }
     45    double[] TestDirectionalSymmetry { get; }
     46    double[] TrainingWeightedDirectionalSymmetry { get; }
     47    double[] TestWeightedDirectionalSymmetry { get; }
     48  }
    5049}
Note: See TracChangeset for help on using the changeset viewer.