Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8100


Ignore:
Timestamp:
06/25/12 10:16:31 (12 years ago)
Author:
mkommend
Message:

#1811: Removed unnecessary code in ErrorCharacteristicsCurveViews.

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  
    2626      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
    2727      this.SuspendLayout();
    28       //
    29       // chart
    30       //
    31       this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
    32       //
     28      //
    3329      // SymbolicRegressionSolutionErrorCharacteristicsCurveView
    3430      //
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs

    r7259 r8100  
    2323using System.Linq;
    2424using System.Windows.Forms;
    25 using System.Windows.Forms.DataVisualization.Charting;
    2625using HeuristicLab.Algorithms.DataAnalysis;
    2726using HeuristicLab.MainForm;
     
    7372      foreach (var variable in usedVariables) {
    7473        problemData.InputVariables.SetItemCheckedState(
    75           problemData.InputVariables.Where(x => x.Value == variable).First(), true);
     74          problemData.InputVariables.First(x => x.Value == variable), true);
    7675      }
    7776
     
    9089      base.Content_ProblemDataChanged(sender, e);
    9190    }
    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     }
    10191  }
    10292}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r7701 r8100  
    2626using System.Windows.Forms.DataVisualization.Charting;
    2727using HeuristicLab.MainForm;
    28 using HeuristicLab.MainForm.WindowsForms;
    2928
    3029namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3231  [Content(typeof(IRegressionSolution))]
    3332  public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView {
    34     private IRegressionSolution constantModel;
    3533    protected const string TrainingSamples = "Training";
    3634    protected const string TestSamples = "Test";
     
    103101      if (Content == null) return;
    104102
     103      var constantModel = CreateConstantModel();
    105104      var originalValues = GetOriginalValues().ToList();
    106       constantModel = CreateConstantModel();
    107105      var baselineEstimatedValues = GetEstimatedValues(constantModel);
    108106      var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues);
     
    201199    }
    202200
    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 
    208201    protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) {
    209202      return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
Note: See TracChangeset for help on using the changeset viewer.