Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/11 14:41:17 (14 years ago)
Author:
gkronber
Message:

#1418 ported estimated values view for classification and regression solutions and porter scatter plot and line chart for regression solutions.

Location:
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
Files:
1 added
6 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.Designer.cs

    r5642 r5663  
    2020#endregion
    2121namespace HeuristicLab.Problems.DataAnalysis.Views {
    22   partial class EstimatedValuesView {
     22  partial class RegressionSolutionEstimatedValuesView {
    2323    /// <summary>
    2424    /// Required designer variable.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs

    r5642 r5663  
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Views {
    30   [View("Estimated Values View")]
    31   [Content(typeof(DataAnalysisSolution))]
    32   public partial class EstimatedValuesView : AsynchronousContentView {
     30  [View("Regression solution estimated values view")]
     31  [Content(typeof(IRegressionSolution))]
     32  public partial class RegressionSolutionEstimatedValuesView : AsynchronousContentView {
    3333    private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
    3434    private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
    3535
    36     public new DataAnalysisSolution Content {
    37       get { return (DataAnalysisSolution)base.Content; }
     36    public new IRegressionSolution Content {
     37      get { return (IRegressionSolution)base.Content; }
    3838      set {
    3939        base.Content = value;
     
    4343    private StringConvertibleMatrixView matrixView;
    4444
    45     public EstimatedValuesView()
     45    public RegressionSolutionEstimatedValuesView()
    4646      : base() {
    4747      InitializeComponent();
     
    5656    protected override void RegisterContentEvents() {
    5757      base.RegisterContentEvents();
    58       Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
     58      Content.ModelChanged += new EventHandler(Content_ModelChanged);
    5959      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    6060    }
     
    6262    protected override void DeregisterContentEvents() {
    6363      base.DeregisterContentEvents();
    64       Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
     64      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    6565      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    6666    }
    6767
    68     void Content_ProblemDataChanged(object sender, EventArgs e) {
     68    private void Content_ProblemDataChanged(object sender, EventArgs e) {
    6969      OnContentChanged();
    7070    }
    7171
    72     void Content_EstimatedValuesChanged(object sender, EventArgs e) {
     72    private void Content_ModelChanged(object sender, EventArgs e) {
    7373      OnContentChanged();
    7474    }
     
    8686          double[,] values = new double[Content.ProblemData.Dataset.Rows, 4];
    8787
    88           double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value);
     88          double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable);
    8989          double[] estimated = Content.EstimatedValues.ToArray();
    9090          for (int row = 0; row < target.Length; row++) {
     
    9696
    9797          matrix = new DoubleMatrix(values);
    98           matrix.ColumnNames = new string[] { "Original", "Estimated", "Error", "Rel. Error" };
     98          matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, "Absolute Error", "Relative Error" };
    9999        }
    100100        matrixView.Content = matrix;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.Designer.cs

    r5642 r5663  
    2020#endregion
    2121namespace HeuristicLab.Problems.DataAnalysis.Views {
    22   partial class LineChartView {
     22  partial class RegressionSolutionLineChartView {
    2323    /// <summary>
    2424    /// Required designer variable.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r5642 r5663  
    2828
    2929namespace HeuristicLab.Problems.DataAnalysis.Views {
    30   [View("Line Chart View")]
    31   [Content(typeof(DataAnalysisSolution))]
    32   public partial class LineChartView : AsynchronousContentView {
     30  [View("Regression solution line chart")]
     31  [Content(typeof(IRegressionSolution))]
     32  public partial class RegressionSolutionLineChartView : AsynchronousContentView {
    3333    private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
    3434    private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
    3535
    36     public new DataAnalysisSolution Content {
    37       get { return (DataAnalysisSolution)base.Content; }
     36    public new IRegressionSolution Content {
     37      get { return (IRegressionSolution)base.Content; }
    3838      set { base.Content = value; }
    3939    }
    4040
    41     public LineChartView()
     41    public RegressionSolutionLineChartView()
    4242      : base() {
    4343      InitializeComponent();
     
    5757      if (Content != null) {
    5858        this.chart.Series.Add(TARGETVARIABLE_SERIES_NAME);
    59         this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable.Value;
     59        this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = Content.ProblemData.TargetVariable;
    6060        this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine;
    61         this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value));
     61        this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindY(Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable));
    6262        this.UpdateStripLines();
    6363
     
    8585    protected override void RegisterContentEvents() {
    8686      base.RegisterContentEvents();
    87       Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
     87      Content.ModelChanged += new EventHandler(Content_ModelChanged);
    8888      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    8989    }
    9090    protected override void DeregisterContentEvents() {
    9191      base.DeregisterContentEvents();
    92       Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
     92      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    9393      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    9494    }
     
    9898    }
    9999
    100     private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
     100    private void Content_ModelChanged(object sender, EventArgs e) {
    101101      UpdateEstimatedValuesLineChart();
    102102    }
     
    136136      this.chart.ChartAreas[0].AxisX.StripLines.Clear();
    137137      this.CreateAndAddStripLine("Training", Color.FromArgb(20, Color.Green),
    138         Content.ProblemData.TrainingSamplesStart.Value,
    139         Content.ProblemData.TrainingSamplesEnd.Value);
     138        Content.ProblemData.TrainingPartitionStart.Value,
     139        Content.ProblemData.TrainingPartitionEnd.Value);
    140140      this.CreateAndAddStripLine("Test", Color.FromArgb(20, Color.Red),
    141         Content.ProblemData.TestSamplesStart.Value,
    142         Content.ProblemData.TestSamplesEnd.Value);
     141        Content.ProblemData.TestPartitionStart.Value,
     142        Content.ProblemData.TestPartitionEnd.Value);
    143143    }
    144144
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.Designer.cs

    r5642 r5663  
    2121
    2222namespace HeuristicLab.Problems.DataAnalysis.Views {
    23   partial class ScatterPlotView {
     23  partial class RegressionSolutionScatterPlotView {
    2424    /// <summary>
    2525    /// Required designer variable.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs

    r5642 r5663  
    2929
    3030namespace HeuristicLab.Problems.DataAnalysis.Views {
    31   [View("Scatter Plot View")]
    32   [Content(typeof(DataAnalysisSolution), true)]
    33   public partial class ScatterPlotView : AsynchronousContentView {
    34     private const string ALL_SERIES = "All Samples";
    35     private const string TRAINING_SERIES = "Training Samples";
    36     private const string TEST_SERIES = "Test Samples";
    37 
    38     public new DataAnalysisSolution Content {
    39       get { return (DataAnalysisSolution)base.Content; }
     31  [View("Regression solution scatter plot")]
     32  [Content(typeof(IRegressionSolution))]
     33  public partial class RegressionSolutionScatterPlotView : AsynchronousContentView {
     34    private const string ALL_SERIES = "All samples";
     35    private const string TRAINING_SERIES = "Training samples";
     36    private const string TEST_SERIES = "Test samples";
     37
     38    public new IRegressionSolution Content {
     39      get { return (IRegressionSolution)base.Content; }
    4040      set { base.Content = value; }
    4141    }
    4242
    43     public ScatterPlotView()
     43    public RegressionSolutionScatterPlotView()
    4444      : base() {
    4545      InitializeComponent();
     
    7777    protected override void RegisterContentEvents() {
    7878      base.RegisterContentEvents();
    79       Content.EstimatedValuesChanged += new EventHandler(Content_EstimatedValuesChanged);
     79      Content.ModelChanged += new EventHandler(Content_ModelChanged);
    8080      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    8181    }
    8282    protected override void DeregisterContentEvents() {
    8383      base.DeregisterContentEvents();
    84       Content.EstimatedValuesChanged -= new EventHandler(Content_EstimatedValuesChanged);
     84      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    8585      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    8686    }
     
    9090      UpdateChart();
    9191    }
    92     private void Content_EstimatedValuesChanged(object sender, EventArgs e) {
     92    private void Content_ModelChanged(object sender, EventArgs e) {
    9393      UpdateSeries();
    9494    }
     
    126126      if (InvokeRequired) Invoke((Action)UpdateSeries);
    127127      else {
    128         string targetVariableName = Content.ProblemData.TargetVariable.Value;
     128        string targetVariableName = Content.ProblemData.TargetVariable;
    129129        Dataset dataset = Content.ProblemData.Dataset;
    130130        if (this.chart.Series[ALL_SERIES].Points.Count > 0)
     
    170170        }
    171171      } else if (Content != null) {
    172         string targetVariableName = Content.ProblemData.TargetVariable.Value;
     172        string targetVariableName = Content.ProblemData.TargetVariable;
    173173
    174174        IEnumerable<double> predictedValues = null;
Note: See TracChangeset for help on using the changeset viewer.