Changeset 8100
- Timestamp:
- 06/25/12 10:16:31 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs
r7967 r8100 26 26 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); 27 27 this.SuspendLayout(); 28 // 29 // chart 30 // 31 this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown); 32 // 28 // 33 29 // SymbolicRegressionSolutionErrorCharacteristicsCurveView 34 30 // -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
r7259 r8100 23 23 using System.Linq; 24 24 using System.Windows.Forms; 25 using System.Windows.Forms.DataVisualization.Charting;26 25 using HeuristicLab.Algorithms.DataAnalysis; 27 26 using HeuristicLab.MainForm; … … 73 72 foreach (var variable in usedVariables) { 74 73 problemData.InputVariables.SetItemCheckedState( 75 problemData.InputVariables. Where(x => x.Value == variable).First(), true);74 problemData.InputVariables.First(x => x.Value == variable), true); 76 75 } 77 76 … … 90 89 base.Content_ProblemDataChanged(sender, e); 91 90 } 92 93 private void chart_MouseDown(object sender, MouseEventArgs e) {94 if (e.Clicks < 2) return;95 HitTestResult result = chart.HitTest(e.X, e.Y);96 if (result.ChartElementType != ChartElementType.LegendItem) return;97 if (result.Series.Name != linearRegressionSolution.Name) return;98 99 MainFormManager.MainForm.ShowContent((IRegressionSolution)result.Series.Tag);100 }101 91 } 102 92 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r7701 r8100 26 26 using System.Windows.Forms.DataVisualization.Charting; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.MainForm.WindowsForms;29 28 30 29 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 32 31 [Content(typeof(IRegressionSolution))] 33 32 public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView { 34 private IRegressionSolution constantModel;35 33 protected const string TrainingSamples = "Training"; 36 34 protected const string TestSamples = "Test"; … … 103 101 if (Content == null) return; 104 102 103 var constantModel = CreateConstantModel(); 105 104 var originalValues = GetOriginalValues().ToList(); 106 constantModel = CreateConstantModel();107 105 var baselineEstimatedValues = GetEstimatedValues(constantModel); 108 106 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues); … … 201 199 } 202 200 203 protected IEnumerable<double> GetbaselineEstimatedValues(IEnumerable<double> originalValues) {204 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();205 return Enumerable.Repeat(averageTrainingTarget, originalValues.Count());206 }207 208 201 protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) { 209 202 return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
Note: See TracChangeset
for help on using the changeset viewer.