Changeset 7842 for branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Timestamp:
- 05/16/12 16:28:49 (13 years ago)
- Location:
- branches/HeuristicLab.TimeSeries
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TimeSeries
- Property svn:mergeinfo changed
-
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs
r7043 r7842 49 49 this.chart.TabIndex = 0; 50 50 this.chart.Text = "chart"; 51 this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown); 51 this.chart.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.Chart_MouseDoubleClick); 52 this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove); 52 53 // 53 54 // label1 -
branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r7268 r7842 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.MainForm.WindowsForms; 29 29 30 namespace HeuristicLab.Problems.DataAnalysis.Views { 30 31 [View("Error Characteristics Curve")] … … 104 105 var originalValues = GetOriginalValues().ToList(); 105 106 constantModel = CreateConstantModel(); 106 var meanModelEstimatedValues = GetEstimatedValues(constantModel);107 var meanModelResiduals = GetResiduals(originalValues, meanModelEstimatedValues);108 109 meanModelResiduals.Sort();110 chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling( meanModelResiduals.Last());111 chart.ChartAreas[0].CursorX.Interval = meanModelResiduals.First() / 100;112 113 Series meanModelSeries = new Series("Mean Model");114 meanModelSeries.ChartType = SeriesChartType.FastLine;115 UpdateSeries( meanModelResiduals, meanModelSeries);116 meanModelSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(meanModelSeries);117 meanModelSeries.Tag = constantModel;118 chart.Series.Add( meanModelSeries);107 var baselineEstimatedValues = GetEstimatedValues(constantModel); 108 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues); 109 110 baselineResiduals.Sort(); 111 chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(baselineResiduals.Last()); 112 chart.ChartAreas[0].CursorX.Interval = baselineResiduals.First() / 100; 113 114 Series baselineSeries = new Series("Baseline"); 115 baselineSeries.ChartType = SeriesChartType.FastLine; 116 UpdateSeries(baselineResiduals, baselineSeries); 117 baselineSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(baselineSeries); 118 baselineSeries.Tag = constantModel; 119 chart.Series.Add(baselineSeries); 119 120 120 121 AddRegressionSolution(Content); … … 200 201 } 201 202 202 protected IEnumerable<double> Get MeanModelEstimatedValues(IEnumerable<double> originalValues) {203 protected IEnumerable<double> GetbaselineEstimatedValues(IEnumerable<double> originalValues) { 203 204 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average(); 204 205 return Enumerable.Repeat(averageTrainingTarget, originalValues.Count()); … … 229 230 } 230 231 231 #region Mean Model 232 private void chart_MouseDown(object sender, MouseEventArgs e) { 233 if (e.Clicks < 2) return; 232 #region Baseline 233 private void Chart_MouseDoubleClick(object sender, MouseEventArgs e) { 234 234 HitTestResult result = chart.HitTest(e.X, e.Y); 235 235 if (result.ChartElementType != ChartElementType.LegendItem) return; 236 if (result.Series.Name != constantModel.Name) return;237 236 238 237 MainFormManager.MainForm.ShowContent((IRegressionSolution)result.Series.Tag); … … 242 241 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average(); 243 242 var solution = new ConstantRegressionModel(averageTrainingTarget).CreateRegressionSolution(ProblemData); 244 solution.Name = " Mean Model";243 solution.Name = "Baseline"; 245 244 return solution; 246 245 } 247 246 #endregion 247 248 private void chart_MouseMove(object sender, MouseEventArgs e) { 249 HitTestResult result = chart.HitTest(e.X, e.Y); 250 if (result.ChartElementType == ChartElementType.LegendItem) 251 Cursor = Cursors.Hand; 252 else 253 Cursor = Cursors.Default; 254 } 248 255 } 249 256 }
Note: See TracChangeset
for help on using the changeset viewer.