Changeset 7085 for branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Timestamp:
- 11/28/11 13:47:28 (13 years ago)
- Location:
- branches/RegressionBenchmarks
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RegressionBenchmarks
- Property svn:ignore
-
old new 4 4 *.suo 5 5 *.vsp 6 Doxygen 6 7 Google.ProtocolBuffers-0.9.1.dll 7 8 HeuristicLab 3.3.5.1.ReSharper.user 8 9 HeuristicLab 3.3.6.0.ReSharper.user 9 10 HeuristicLab.4.5.resharper.user 11 HeuristicLab.ExtLibs.6.0.ReSharper.user 10 12 HeuristicLab.resharper.user 11 13 ProtoGen.exe … … 16 18 bin 17 19 protoc.exe 18 HeuristicLab.ExtLibs.6.0.ReSharper.user19 Doxygen
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs
r6642 r7085 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 52 // 52 53 // label1 -
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r6750 r7085 31 31 [Content(typeof(IRegressionSolution))] 32 32 public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView { 33 private IRegressionSolution constantModel; 33 34 protected const string TrainingSamples = "Training"; 34 35 protected const string TestSamples = "Test"; … … 101 102 if (Content == null) return; 102 103 103 var originalValues = GetOriginalValues(); 104 var meanModelEstimatedValues = GetMeanModelEstimatedValues(originalValues); 104 var originalValues = GetOriginalValues().ToList(); 105 constantModel = CreateConstantModel(); 106 var meanModelEstimatedValues = GetEstimatedValues(constantModel); 105 107 var meanModelResiduals = GetResiduals(originalValues, meanModelEstimatedValues); 106 108 … … 113 115 UpdateSeries(meanModelResiduals, meanModelSeries); 114 116 meanModelSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(meanModelSeries); 117 meanModelSeries.Tag = constantModel; 115 118 chart.Series.Add(meanModelSeries); 116 119 … … 133 136 series.Points.Clear(); 134 137 residuals.Sort(); 138 if (!residuals.Any() || residuals.All(double.IsNaN)) return; 135 139 136 140 series.Points.AddXY(0, 0); … … 146 150 147 151 point.XValue = residuals[i]; 148 point.YValues[0] = ((double)i +1) / residuals.Count;152 point.YValues[0] = ((double)i + 1) / residuals.Count; 149 153 point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0]; 150 154 series.Points.Add(point); … … 206 210 207 211 private double CalculateAreaOverCurve(Series series) { 208 if (series.Points.Count < 1) throw new ArgumentException("Could not calculate area under curve if less than 1 data points were given.");212 if (series.Points.Count < 1) return 0; 209 213 210 214 double auc = 0.0; … … 224 228 else UpdateChart(); 225 229 } 230 231 #region Mean Model 232 private void chart_MouseDown(object sender, MouseEventArgs e) { 233 if (e.Clicks < 2) return; 234 HitTestResult result = chart.HitTest(e.X, e.Y); 235 if (result.ChartElementType != ChartElementType.LegendItem) return; 236 if (result.Series.Name != constantModel.Name) return; 237 238 MainFormManager.MainForm.ShowContent((IRegressionSolution)result.Series.Tag); 239 } 240 241 private IRegressionSolution CreateConstantModel() { 242 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average(); 243 var solution = new ConstantRegressionModel(averageTrainingTarget).CreateRegressionSolution(ProblemData); 244 solution.Name = "Mean Model"; 245 return solution; 246 } 247 #endregion 226 248 } 227 249 } -
branches/RegressionBenchmarks/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r6740 r7085 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 22 using System.Drawing; 24 23 using System.Linq; … … 172 171 string targetVariableName = Content.ProblemData.TargetVariable; 173 172 174 IEnumerable<double>predictedValues = null;175 IEnumerable<double>targetValues = null;173 double[] predictedValues = null; 174 double[] targetValues = null; 176 175 switch (series.Name) { 177 176 case ALL_SERIES: … … 188 187 break; 189 188 } 190 series.Points.DataBindXY(predictedValues, "", targetValues, ""); 189 if (predictedValues.Length == targetValues.Length) 190 series.Points.DataBindXY(predictedValues, "", targetValues, ""); 191 191 this.chart.Legends[series.Legend].ForeColor = Color.Black; 192 192 UpdateCursorInterval();
Note: See TracChangeset
for help on using the changeset viewer.