Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5663 for branches


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
Files:
3 added
1 edited
8 copied

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionEstimatedClassValuesView.Designer.cs

    r5642 r5663  
    2020#endregion
    2121namespace HeuristicLab.Problems.DataAnalysis.Views {
    22   partial class EstimatedValuesView {
     22  partial class ClassificationSolutionEstimatedClassValuesView {
    2323    /// <summary>
    2424    /// Required designer variable.
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionEstimatedClassValuesView.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("Classification solution estimated class values view")]
     31  [Content(typeof(IClassificationSolution))]
     32  public partial class ClassificationSolutionEstimatedClassValuesView : AsynchronousContentView {
    3333    private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable";
    34     private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedValues";
     34    private const string ESTIMATEDVALUES_SERIES_NAME = "EstimatedClassValues";
    3535
    36     public new DataAnalysisSolution Content {
    37       get { return (DataAnalysisSolution)base.Content; }
     36    public new IClassificationSolution Content {
     37      get { return (IClassificationSolution)base.Content; }
    3838      set {
    3939        base.Content = value;
     
    4343    private StringConvertibleMatrixView matrixView;
    4444
    45     public EstimatedValuesView()
     45    public ClassificationSolutionEstimatedClassValuesView()
    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    }
     
    8484        DoubleMatrix matrix = null;
    8585        if (Content != null) {
    86           double[,] values = new double[Content.ProblemData.Dataset.Rows, 4];
     86          double[,] values = new double[Content.ProblemData.Dataset.Rows, 2];
    8787
    88           double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value);
    89           double[] estimated = Content.EstimatedValues.ToArray();
     88          double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable);
     89          double[] estimated = Content.EstimatedClassValues.ToArray();
    9090          for (int row = 0; row < target.Length; row++) {
    9191            values[row, 0] = target[row];
    9292            values[row, 1] = estimated[row];
    93             values[row, 2] = estimated[row] - target[row];
    94             values[row, 3] = estimated[row] / target[row] - 1;
    9593          }
    9694
    9795          matrix = new DoubleMatrix(values);
    98           matrix.ColumnNames = new string[] { "Original", "Estimated", "Error", "Rel. Error" };
     96          matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME };
    9997        }
    10098        matrixView.Content = matrix;
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r5623 r5663  
    110110  </ItemGroup>
    111111  <ItemGroup>
     112    <Compile Include="Classification\ClassificationSolutionEstimatedClassValuesView.cs">
     113      <SubType>UserControl</SubType>
     114    </Compile>
     115    <Compile Include="Classification\ClassificationSolutionEstimatedClassValuesView.Designer.cs">
     116      <DependentUpon>ClassificationSolutionEstimatedClassValuesView.cs</DependentUpon>
     117    </Compile>
     118    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.cs">
     119      <SubType>UserControl</SubType>
     120    </Compile>
     121    <Compile Include="Regression\RegressionSolutionEstimatedValuesView.Designer.cs">
     122      <DependentUpon>RegressionSolutionEstimatedValuesView.cs</DependentUpon>
     123    </Compile>
     124    <Compile Include="Regression\RegressionSolutionLineChartView.cs">
     125      <SubType>UserControl</SubType>
     126    </Compile>
     127    <Compile Include="Regression\RegressionSolutionLineChartView.Designer.cs">
     128      <DependentUpon>RegressionSolutionLineChartView.cs</DependentUpon>
     129    </Compile>
     130    <Compile Include="Regression\RegressionSolutionScatterPlotView.cs">
     131      <SubType>UserControl</SubType>
     132    </Compile>
     133    <Compile Include="Regression\RegressionSolutionScatterPlotView.Designer.cs">
     134      <DependentUpon>RegressionSolutionScatterPlotView.cs</DependentUpon>
     135    </Compile>
    112136    <None Include="HeuristicLab.snk" />
    113137    <None Include="HeuristicLabProblemsDataAnalysisViewsPlugin.cs.frame" />
     
    186210      <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project>
    187211      <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name>
     212    </ProjectReference>
     213    <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj">
     214      <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project>
     215      <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name>
    188216    </ProjectReference>
    189217  </ItemGroup>
     
    204232      <Install>true</Install>
    205233    </BootstrapperPackage>
     234  </ItemGroup>
     235  <ItemGroup>
     236    <Folder Include="Clustering\" />
    206237  </ItemGroup>
    207238  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • 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.