- Timestamp:
- 07/06/14 14:14:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r10500 r11093 99 99 chart.Series.Clear(); 100 100 chart.Annotations.Clear(); 101 101 102 if (Content == null) return; 102 103 var constantModel = CreateConstantModel();104 var originalValues = GetOriginalValues().ToList(); 105 var baselineEstimatedValues = GetEstimatedValues(constantModel);106 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues);107 108 baselineResiduals.Sort();109 chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(baselineResiduals.Last());110 chart.ChartAreas[0].CursorX.Interval = baselineResiduals.First() / 100; 111 112 Series baselineSeries = new Series("Baseline");113 baselineSeries.ChartType = SeriesChartType.FastLine;114 UpdateSeries(baselineResiduals,baselineSeries);115 baselineSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(baselineSeries);116 baselineSeries.Tag = constantModel;117 baselineSeries.LegendToolTip = "Double-click to open model";118 chart.Series.Add(baselineSeries);103 if (cmbSamples.SelectedItem.ToString() == TrainingSamples && !ProblemData.TrainingIndices.Any()) return; 104 if (cmbSamples.SelectedItem.ToString() == TestSamples && !ProblemData.TestIndices.Any()) return; 105 106 if (Content.ProblemData.TrainingIndices.Any()) { 107 var constantModel = CreateConstantModel(); 108 var originalValues = GetOriginalValues().ToList(); 109 var baselineEstimatedValues = GetEstimatedValues(constantModel); 110 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues); 111 112 Series baselineSeries = new Series("Baseline"); 113 baselineSeries.ChartType = SeriesChartType.FastLine; 114 UpdateSeries(baselineResiduals, baselineSeries); 115 baselineSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(baselineSeries); 116 baselineSeries.Tag = constantModel; 117 baselineSeries.LegendToolTip = "Double-click to open model"; 118 chart.Series.Add(baselineSeries); 119 } 119 120 120 121 AddRegressionSolution(Content); … … 127 128 solutionSeries.Tag = solution; 128 129 solutionSeries.ChartType = SeriesChartType.FastLine; 129 var estimatedValues = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution)); 130 UpdateSeries(estimatedValues, solutionSeries); 130 var residuals = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution)); 131 132 chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(residuals.Max()); 133 chart.ChartAreas[0].CursorX.Interval = residuals.Min() / 100; 134 135 UpdateSeries(residuals, solutionSeries); 136 131 137 solutionSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(solutionSeries); 132 138 solutionSeries.LegendToolTip = "Double-click to open model"; … … 236 242 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average(); 237 243 var model = new ConstantRegressionModel(averageTrainingTarget); 238 var solution = new ConstantRegressionSolution(model, (IRegressionProblemData)ProblemData.Clone());244 var solution = new ConstantRegressionSolution(model, (IRegressionProblemData)ProblemData.Clone()); 239 245 solution.Name = "Baseline"; 240 246 return solution;
Note: See TracChangeset
for help on using the changeset viewer.