Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/08/14 19:36:38 (10 years ago)
Author:
mkommend
Message:

#2197: Merged r11093 into 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

    r9462 r11149  
    2222using System.Collections.Generic;
    2323using System.Linq;
    24 using System.Windows.Forms;
    2524using HeuristicLab.MainForm;
    26 using HeuristicLab.MainForm.WindowsForms;
     25
    2726namespace HeuristicLab.Problems.DataAnalysis.Views {
    2827  [View("Error Characteristics Curve")]
     
    5150      if (Content == null) return;
    5251
    53       //AR1 model
    54       double alpha, beta;
    55       OnlineCalculatorError errorState;
    5652      IEnumerable<double> trainingStartValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices.Select(r => r - 1).Where(r => r > 0)).ToList();
    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);
     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      }
    6162    }
    6263  }
Note: See TracChangeset for help on using the changeset viewer.