Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/14/15 21:47:38 (9 years ago)
Author:
gkronber
Message:

#2452 refactored RegressionSolutionErrorCharacteristicsCurveView to better support comparison of a set of solutions in one chart (via drag&drop)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionErrorCharacteristicsCurveView.cs

    r12012 r13003  
    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.