Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/26/15 18:26:57 (9 years ago)
Author:
gkronber
Message:

#2452: merged r13002:13004 from trunk to stable

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs

    r12009 r13062  
    2828  [Content(typeof(ITimeSeriesPrognosisSolution))]
    2929  public partial class TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView : RegressionSolutionErrorCharacteristicsCurveView {
    30 
    31 
    3230    public TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView()
    3331      : base() {
     
    4644    }
    4745
    48     protected override void UpdateChart() {
    49       base.UpdateChart();
    50       if (Content == null) return;
     46    protected override IEnumerable<IRegressionSolution> CreateBaselineSolutions() {
     47      foreach (var sol in base.CreateBaselineSolutions())
     48        yield return sol;
    5149
    5250      IEnumerable<double> trainingStartValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Select(r => r - 1).Where(r => r > 0)).ToList();
    53       if (trainingStartValues.Any()) {
    54         //AR1 model
    55         double alpha, beta;
    56         OnlineCalculatorError errorState;
    57         OnlineLinearScalingParameterCalculator.Calculate(ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState);
    58         var ar1model = new TimeSeriesPrognosisAutoRegressiveModel(ProblemData.TargetVariable, new double[] { beta }, alpha).CreateTimeSeriesPrognosisSolution(ProblemData);
    59         ar1model.Name = "AR(1) Model";
    60         AddRegressionSolution(ar1model);
    61       }
     51      //AR1 model
     52      double alpha, beta;
     53      OnlineCalculatorError errorState;
     54      OnlineLinearScalingParameterCalculator.Calculate(ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Where(x => x > 0)), trainingStartValues, out alpha, out beta, out errorState);
     55      var ar1Solution = new TimeSeriesPrognosisAutoRegressiveModel(ProblemData.TargetVariable, new double[] { beta }, alpha).CreateTimeSeriesPrognosisSolution(ProblemData);
     56      ar1Solution.Name = "AR(1)";
     57      yield return ar1Solution;
    6258    }
    6359  }
Note: See TracChangeset for help on using the changeset viewer.