Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/07/11 22:47:12 (13 years ago)
Author:
gkronber
Message:

#1081: worked on multi-variate time series prognosis

Location:
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionLineChartView.cs

    r7129 r7154  
    9191          this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points
    9292            .DataBindXY(Content.ProblemData.TrainingIndizes.ToArray(),
    93                         Content.PrognosedTrainingValues.ElementAt(varIndex).ToArray());
     93                        Content.PrognosedTrainingValues.SelectMany(x => x).Skip(varIndex).TakeEvery(Content.ProblemData.TargetVariables.Count()).ToArray());
    9494        } else {
    9595          this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Points
    9696            .DataBindXY(Content.ProblemData.TrainingIndizes.ToArray(),
    97                         Content.GetPrognosedValues(Content.ProblemData.TrainingIndizes, 1).Select(v => v.ElementAt(varIndex).First()).ToArray());
     97                        Content.GetPrognosedValues(Content.ProblemData.TrainingIndizes, 1).SelectMany(x => x.Single()).Skip(varIndex).TakeEvery(Content.ProblemData.TargetVariables.Count()).ToArray());
    9898        }
    9999        this.chart.Series[PROGNOSEDVALUES_TRAINING_SERIES_NAME].Tag = Content;
     
    109109          this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points
    110110            .DataBindXY(Content.ProblemData.TestIndizes.ToArray(),
    111                         Content.PrognosedTestValues.ElementAt(varIndex).ToArray());
     111                        Content.PrognosedTestValues.SelectMany(x => x).Skip(varIndex).TakeEvery(Content.ProblemData.TargetVariables.Count()).ToArray());
    112112        } else {
    113113          this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Points
    114114            .DataBindXY(Content.ProblemData.TestIndizes.ToArray(),
    115                         Content.GetPrognosedValues(Content.ProblemData.TestIndizes, 1).Select(
    116                           v => v.ElementAt(varIndex).First()).ToArray());
     115                        Content.GetPrognosedValues(Content.ProblemData.TestIndizes, 1).SelectMany(x => x.Single()).Skip(varIndex).TakeEvery(Content.ProblemData.TargetVariables.Count()).ToArray());
    117116        }
    118117        this.chart.Series[PROGNOSEDVALUES_TEST_SERIES_NAME].Tag = Content;
     
    242241          case PROGNOSEDVALUES_TRAINING_SERIES_NAME:
    243242            indizes = Content.ProblemData.TrainingIndizes.ToArray();
    244             predictedValues = Content.PrognosedTrainingValues.ElementAt(varIndex).ToArray();
     243            predictedValues =
     244              Content.PrognosedTrainingValues.SelectMany(x => x).Skip(varIndex).TakeEvery(
     245                Content.ProblemData.TargetVariables.Count()).ToArray();
    245246            break;
    246247          case PROGNOSEDVALUES_TEST_SERIES_NAME:
    247248            indizes = Content.ProblemData.TestIndizes.ToArray();
    248             predictedValues = Content.PrognosedTestValues.ElementAt(varIndex).ToArray();
     249            Content.PrognosedTestValues.SelectMany(x => x).Skip(varIndex).TakeEvery(
     250              Content.ProblemData.TargetVariables.Count()).ToArray();
    249251            break;
    250252        }
  • branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionPrognosedValuesView.cs

    r7100 r7154  
    9393            values[row, 0] = row.ToString();
    9494
    95           var prognosedTraining = Content.PrognosedTrainingValues.ToArray();
    96           var prognosedTest = Content.PrognosedTestValues.ToArray();
     95          var allPrognosedTraining = Content.PrognosedTrainingValues.SelectMany(x=>x).ToArray();
     96          var allPrognosedTest = Content.PrognosedTestValues.SelectMany(x => x).ToArray();
    9797
    9898          int i = 0;
    9999          int targetVariableIndex = 0;
    100100          foreach (var targetVariable in Content.ProblemData.TargetVariables) {
     101            var prognosedTraining =
     102              allPrognosedTraining.Skip(targetVariableIndex).TakeEvery(Content.ProblemData.TargetVariables.Count());
     103            var prognosedTest =
     104              allPrognosedTest.Skip(targetVariableIndex).TakeEvery(Content.ProblemData.TargetVariables.Count());
     105
    101106            double[] target = Content.ProblemData.Dataset.GetDoubleValues(targetVariable).ToArray();
    102107
    103             var prognosedTrainingEnumerator = prognosedTraining[targetVariableIndex].GetEnumerator();
     108            var prognosedTrainingEnumerator = prognosedTraining.GetEnumerator();
    104109            foreach (var row in Content.ProblemData.TrainingIndizes) {
    105110              prognosedTrainingEnumerator.MoveNext();
     
    107112            }
    108113
    109             var prognosedTestEnumerator = prognosedTest[targetVariableIndex].GetEnumerator();
     114            var prognosedTestEnumerator = prognosedTest.GetEnumerator();
    110115            foreach (var row in Content.ProblemData.TestIndizes) {
    111116              prognosedTestEnumerator.MoveNext();
Note: See TracChangeset for help on using the changeset viewer.