Ignore:
Timestamp:
12/13/16 12:30:39 (4 years ago)
Author:
gkronber
Message:

#2718: fixed residual line chart view

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r14483 r14486  
    2727
    2828namespace HeuristicLab.Problems.DataAnalysis.Views {
    29   [View("Line Chart (residuals)")]
     29  [View("Line Chart")]
    3030  [Content(typeof(IRegressionSolution))]
    31   public partial class RegressionSolutionResidualsLineChartView : RegressionSolutionLineChartView, IDataAnalysisSolutionEvaluationView {
     31  public partial class RegressionSolutionLineChartView : RegressionSolutionLineChartViewBase {
    3232
    3333
    34     public RegressionSolutionResidualsLineChartView()
     34    public RegressionSolutionLineChartView()
    3535      : base() {
    3636      InitializeComponent();
    3737    }
    3838
    39     protected override void GetTrainingSeries(out int[] x, out double[] y) {
    40       base.GetTrainingSeries(out x, out y);
    41       var problemData = Content.ProblemData;
    42       var target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, x).ToArray();
    43       for (int i = 0; i < x.Length; i++) {
    44         y[i] -= target[i];
    45       }
     39    protected override void GetTrainingSeries(out int[] idx, out double[] y) {
     40      idx = Content.ProblemData.TrainingIndices.ToArray();
     41      y = Content.EstimatedTrainingValues.ToArray();
    4642    }
    4743
    48     protected override void GetTestSeries(out int[] x, out double[] y) {
    49       base.GetTestSeries(out x, out y);
    50       var problemData = Content.ProblemData;
    51       var target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, x).ToArray();
    52       for (int i = 0; i < x.Length; i++) {
    53         y[i] -= target[i];
    54       }
     44    protected override void GetTestSeries(out int[] idx, out double[] y) {
     45      idx = Content.ProblemData.TestIndices.ToArray();
     46      y = Content.EstimatedTestValues.ToArray();
    5547    }
    5648
    57     protected override void GetAllValuesSeries(out int[] x, out double[] y) {
    58       base.GetAllValuesSeries(out x, out y);
    59       var problemData = Content.ProblemData;
    60       var target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, x).ToArray();
    61       for (int i = 0; i < x.Length; i++) {
    62         y[i] -= target[i];
    63       }
     49    protected override void GetAllValuesSeries(out int[] idx, out double[] y) {
     50      idx = Content.ProblemData.AllIndices.ToArray();
     51      y = Content.EstimatedValues.ToArray();
    6452    }
    65 
    66     protected override void RedrawChart() {
    67       base.RedrawChart();
    68       UpdateSeriesStyle();
    69     }
    70 
    71     private void UpdateSeriesStyle() {
    72       base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TRAINING_SERIES_NAME].YAxisType = AxisType.Secondary;
    73       base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_TEST_SERIES_NAME].YAxisType = AxisType.Secondary;
    74       base.chart.Series[RegressionSolutionLineChartView.ESTIMATEDVALUES_ALL_SERIES_NAME].YAxisType = AxisType.Secondary;
    75     }
    76 
    7753  }
    7854}
Note: See TracChangeset for help on using the changeset viewer.