Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/08/11 13:15:23 (13 years ago)
Author:
mkommend
Message:

#1612: Implemented RegressionSolutionErrorCharacteristicsView and adapted loading of DataAnalysisSolutionEvaluationViews.

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4
Files:
2 added
6 deleted
18 edited
2 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs

    r6613 r6642  
    1919 */
    2020#endregion
    21 
     21using System.Windows.Forms;
     22using HeuristicLab.Core.Views;
     23using HeuristicLab.MainForm;
     24using HeuristicLab.MainForm.WindowsForms;
    2225
    2326namespace HeuristicLab.Problems.DataAnalysis.Views {
    24   #region License Information
    25   /* HeuristicLab
    26  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    27  *
    28  * This file is part of HeuristicLab.
    29  *
    30  * HeuristicLab is free software: you can redistribute it and/or modify
    31  * it under the terms of the GNU General Public License as published by
    32  * the Free Software Foundation, either version 3 of the License, or
    33  * (at your option) any later version.
    34  *
    35  * HeuristicLab is distributed in the hope that it will be useful,
    36  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    37  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    38  * GNU General Public License for more details.
    39  *
    40  * You should have received a copy of the GNU General Public License
    41  * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
    42  */
    43   #endregion
    44   using System.Windows.Forms;
    45   using HeuristicLab.Core;
    46   using HeuristicLab.Core.Views;
    47   using HeuristicLab.MainForm;
    48   using HeuristicLab.MainForm.WindowsForms;
     27  [View("Ensemble Solutions")]
     28  [Content(typeof(ClassificationEnsembleSolution), false)]
     29  internal sealed partial class ClassificationEnsembleSolutionModelView : DataAnalysisSolutionEvaluationView {
     30    private ModelsView view;
    4931
    50   [View("Ensemble Solutions")]
    51   [Content(typeof(IItemCollection<IClassificationSolution>), false)]
    52   internal sealed partial class ClassificationEnsembleSolutionModelView : ItemCollectionView<IClassificationSolution> {
    5332    public ClassificationEnsembleSolutionModelView() {
    5433      InitializeComponent();
     34      view = new ModelsView();
     35      view.Dock = DockStyle.Fill;
     36      Controls.Add(view);
    5537    }
    5638
    57     protected override void SetEnabledStateOfControls() {
    58       base.SetEnabledStateOfControls();
    59       addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked;
    60       removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0;
    61       itemsListView.Enabled = Content != null;
    62       detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
     39    public new ClassificationEnsembleSolution Content {
     40      get { return (ClassificationEnsembleSolution)base.Content; }
     41      set { base.Content = value; }
     42    }
     43
     44    protected override void OnContentChanged() {
     45      base.OnContentChanged();
     46      if (Content != null)
     47        view.Content = Content.ClassificationSolutions;
     48      else
     49        view.Content = null;
     50    }
     51
     52    public override System.Drawing.Image ViewImage {
     53      get { return HeuristicLab.Common.Resources.VSImageLibrary.Properties; }
     54    }
     55
     56    private class ModelsView : ItemCollectionView<IClassificationSolution> {
     57      protected override void SetEnabledStateOfControls() {
     58        base.SetEnabledStateOfControls();
     59        addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked;
     60        removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0;
     61        itemsListView.Enabled = Content != null;
     62        detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
     63      }
    6364    }
    6465  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionConfusionMatrixView.cs

    r6520 r6642  
    2424using System.Linq;
    2525using System.Windows.Forms;
    26 using HeuristicLab.Core.Views;
    2726using HeuristicLab.MainForm;
    2827using HeuristicLab.MainForm.WindowsForms;
     
    3130  [View("Confusion Matrix")]
    3231  [Content(typeof(IClassificationSolution))]
    33   public partial class ClassificationSolutionConfusionMatrixView : ItemView, IClassificationSolutionEvaluationView {
     32  public partial class ClassificationSolutionConfusionMatrixView : DataAnalysisSolutionEvaluationView {
    3433    private const string TrainingSamples = "Training";
    3534    private const string TestSamples = "Test";
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionEstimatedClassValuesView.cs

    r6255 r6642  
    2222using System.Linq;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Core.Views;
    2524using HeuristicLab.Data;
    2625using HeuristicLab.Data.Views;
     
    3130  [View("Estimated Class Values")]
    3231  [Content(typeof(IClassificationSolution))]
    33   public partial class ClassificationSolutionEstimatedClassValuesView : ItemView, IClassificationSolutionEvaluationView {
     32  public partial class ClassificationSolutionEstimatedClassValuesView : DataAnalysisSolutionEvaluationView {
    3433    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
    3534    private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Class Values (all)";
     
    3938    public new IClassificationSolution Content {
    4039      get { return (IClassificationSolution)base.Content; }
    41       set {
    42         base.Content = value;
    43       }
     40      set { base.Content = value; }
    4441    }
    4542
    46     private StringConvertibleMatrixView matrixView;
     43    protected StringConvertibleMatrixView matrixView;
    4744
    4845    public ClassificationSolutionEstimatedClassValuesView()
     
    8279    }
    8380
    84     private void UpdateEstimatedValues() {
     81    protected virtual void UpdateEstimatedValues() {
    8582      if (InvokeRequired) Invoke((Action)UpdateEstimatedValues);
    8683      else {
     
    111108
    112109          matrix = new StringMatrix(values);
    113           matrix.ColumnNames = new string[] {"Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME };
     110          matrix.ColumnNames = new string[] { "Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME };
    114111          matrix.SortableView = true;
    115112        }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs

    r5975 r6642  
    2828using System.Windows.Forms.DataVisualization.Charting;
    2929using HeuristicLab.Common;
    30 using HeuristicLab.Core.Views;
    3130using HeuristicLab.MainForm;
    3231using HeuristicLab.MainForm.WindowsForms;
     
    3433  [View("ROC Curves")]
    3534  [Content(typeof(IDiscriminantFunctionClassificationSolution))]
    36   public partial class DiscriminantFunctionClassificationRocCurvesView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {
     35  public partial class DiscriminantFunctionClassificationRocCurvesView : DataAnalysisSolutionEvaluationView {
    3736    private const string xAxisTitle = "False Positive Rate";
    3837    private const string yAxisTitle = "True Positive Rate";
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionEstimatedClassValuesView.cs

    r6411 r6642  
    2222using System.Linq;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Core.Views;
    2524using HeuristicLab.Data;
    26 using HeuristicLab.Data.Views;
    2725using HeuristicLab.MainForm;
    2826using HeuristicLab.MainForm.WindowsForms;
     
    3129  [View("Estimated Class Values")]
    3230  [Content(typeof(IDiscriminantFunctionClassificationSolution))]
    33   public partial class DiscriminantFunctionClassificationSolutionEstimatedClassValuesView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {
     31  public partial class DiscriminantFunctionClassificationSolutionEstimatedClassValuesView : ClassificationSolutionEstimatedClassValuesView {
    3432    private const string TargetClassValuesSeriesname = "TargetVariable";
    3533    private const string EstimatedClassValuesSeriesName = "EstimatedClassValues";
     
    3836    public new IDiscriminantFunctionClassificationSolution Content {
    3937      get { return (IDiscriminantFunctionClassificationSolution)base.Content; }
    40       set {
    41         base.Content = value;
    42       }
     38      set { base.Content = value; }
    4339    }
    44 
    45     private StringConvertibleMatrixView matrixView;
    4640
    4741    public DiscriminantFunctionClassificationSolutionEstimatedClassValuesView()
    4842      : base() {
    4943      InitializeComponent();
    50       matrixView = new StringConvertibleMatrixView();
    51       matrixView.ShowRowsAndColumnsTextBox = false;
    52       matrixView.ShowStatisticalInformation = false;
    53       matrixView.Dock = DockStyle.Fill;
    54       this.Controls.Add(matrixView);
    5544    }
    5645
    57     #region events
    58     protected override void RegisterContentEvents() {
    59       base.RegisterContentEvents();
    60       Content.ModelChanged += new EventHandler(Content_ModelChanged);
    61       Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
    62     }
    63 
    64     protected override void DeregisterContentEvents() {
    65       base.DeregisterContentEvents();
    66       Content.ModelChanged -= new EventHandler(Content_ModelChanged);
    67       Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
    68     }
    69 
    70     private void Content_ProblemDataChanged(object sender, EventArgs e) {
    71       OnContentChanged();
    72     }
    73 
    74     private void Content_ModelChanged(object sender, EventArgs e) {
    75       OnContentChanged();
    76     }
    77 
    78     protected override void OnContentChanged() {
    79       base.OnContentChanged();
    80       UpdateEstimatedValues();
    81     }
    82 
    83     private void UpdateEstimatedValues() {
     46    protected override void UpdateEstimatedValues() {
    8447      if (InvokeRequired) Invoke((Action)UpdateEstimatedValues);
    8548      else {
     
    10568      }
    10669    }
    107     #endregion
    10870  }
    10971}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs

    r5975 r6642  
    2727using System.Windows.Forms.DataVisualization.Charting;
    2828using HeuristicLab.Common;
    29 using HeuristicLab.Core.Views;
    3029using HeuristicLab.MainForm;
    3130using HeuristicLab.MainForm.WindowsForms;
     
    3433  [View("Classification Threshold")]
    3534  [Content(typeof(IDiscriminantFunctionClassificationSolution), true)]
    36   public sealed partial class DiscriminantFunctionClassificationSolutionThresholdView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {
     35  public sealed partial class DiscriminantFunctionClassificationSolutionThresholdView : DataAnalysisSolutionEvaluationView {
    3736    private const double TrainingAxisValue = 0.0;
    3837    private const double TestAxisValue = 10.0;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Clustering/ClusteringSolutionEstimatedClusterView.cs

    r6003 r6642  
    2222using System.Linq;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Core.Views;
    2524using HeuristicLab.Data;
    2625using HeuristicLab.Data.Views;
     
    3130  [View("Estimated Clusters")]
    3231  [Content(typeof(IClusteringSolution))]
    33   public partial class ClusteringSolutionEstimatedClusterView : ItemView, IClusteringSolutionEvaluationView {
     32  public partial class ClusteringSolutionEstimatedClusterView : DataAnalysisSolutionEvaluationView {
    3433    private const string CLUSTER_NAMES = "Cluster";
    3534
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r6613 r6642  
    116116      <DependentUpon>ClassificationEnsembleSolutionModelView.cs</DependentUpon>
    117117    </Compile>
     118    <Compile Include="DataAnalysisSolutionEvaluationView.cs">
     119      <SubType>UserControl</SubType>
     120    </Compile>
     121    <Compile Include="DataAnalysisSolutionEvaluationView.Designer.cs">
     122      <DependentUpon>DataAnalysisSolutionEvaluationView.cs</DependentUpon>
     123    </Compile>
     124    <Compile Include="Regression\RegressionSolutionErrorCharacteristicsCurveView.cs">
     125      <SubType>UserControl</SubType>
     126    </Compile>
     127    <Compile Include="Regression\RegressionSolutionErrorCharacteristicsCurveView.Designer.cs">
     128      <DependentUpon>RegressionSolutionErrorCharacteristicsCurveView.cs</DependentUpon>
     129    </Compile>
    118130    <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs">
    119131      <SubType>UserControl</SubType>
     
    170182      <DependentUpon>ClusteringSolutionView.cs</DependentUpon>
    171183    </Compile>
    172     <Compile Include="Solution Views\ClassificationEnsembleSolutionView.cs">
    173       <SubType>UserControl</SubType>
    174     </Compile>
    175     <Compile Include="Solution Views\ClassificationEnsembleSolutionView.Designer.cs">
    176       <DependentUpon>ClassificationEnsembleSolutionView.cs</DependentUpon>
    177     </Compile>
    178184    <Compile Include="Solution Views\DiscriminantFunctionClassificationSolutionView.cs">
    179185      <SubType>UserControl</SubType>
     
    182188      <DependentUpon>DiscriminantFunctionClassificationSolutionView.cs</DependentUpon>
    183189    </Compile>
    184     <Compile Include="Interfaces\IDiscriminantFunctionClassificationSolutionEvaluationView.cs" />
    185     <Compile Include="Interfaces\IClusteringSolutionEvaluationView.cs" />
    186     <Compile Include="Interfaces\IClassificationSolutionEvaluationView.cs" />
    187190    <Compile Include="Solution Views\DataAnalysisSolutionView.cs">
    188191      <SubType>UserControl</SubType>
     
    197200      <DependentUpon>DoubleLimitView.cs</DependentUpon>
    198201    </Compile>
    199     <Compile Include="Interfaces\IRegressionSolutionEvaluationView.cs" />
     202    <Compile Include="Interfaces\IDataAnalysisSolutionEvaluationView.cs" />
    200203    <Compile Include="MenuItems\CreateEnsembleMenuItem.cs" />
    201     <Compile Include="Solution Views\RegressionEnsembleSolutionView.cs">
    202       <SubType>UserControl</SubType>
    203     </Compile>
    204     <Compile Include="Solution Views\RegressionEnsembleSolutionView.Designer.cs">
    205       <DependentUpon>RegressionEnsembleSolutionView.cs</DependentUpon>
    206     </Compile>
    207204    <Compile Include="Solution Views\RegressionSolutionView.cs">
    208205      <SubType>UserControl</SubType>
     
    336333    </BootstrapperPackage>
    337334  </ItemGroup>
    338   <ItemGroup />
    339335  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    340336  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDataAnalysisSolutionEvaluationView.cs

    r6638 r6642  
    2121
    2222
     23using System.Drawing;
     24using HeuristicLab.MainForm;
    2325namespace HeuristicLab.Problems.DataAnalysis.Views {
    24   public interface IRegressionSolutionEvaluationView {
    25     new IRegressionSolution Content { get; set; }
     26  public interface IDataAnalysisSolutionEvaluationView :IContentView {
     27    Image ViewImage { get; }
    2628  }
    2729}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs

    r6612 r6642  
    1919 */
    2020#endregion
    21 
     21using System.Windows.Forms;
     22using HeuristicLab.Core.Views;
     23using HeuristicLab.MainForm;
     24using HeuristicLab.MainForm.WindowsForms;
    2225
    2326namespace HeuristicLab.Problems.DataAnalysis.Views {
    24   #region License Information
    25   /* HeuristicLab
    26  * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    27  *
    28  * This file is part of HeuristicLab.
    29  *
    30  * HeuristicLab is free software: you can redistribute it and/or modify
    31  * it under the terms of the GNU General Public License as published by
    32  * the Free Software Foundation, either version 3 of the License, or
    33  * (at your option) any later version.
    34  *
    35  * HeuristicLab is distributed in the hope that it will be useful,
    36  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    37  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    38  * GNU General Public License for more details.
    39  *
    40  * You should have received a copy of the GNU General Public License
    41  * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
    42  */
    43   #endregion
    44   using System.Windows.Forms;
    45   using HeuristicLab.Core;
    46   using HeuristicLab.Core.Views;
    47   using HeuristicLab.MainForm;
    48   using HeuristicLab.MainForm.WindowsForms;
     27  [View("Ensemble Solutions")]
     28  [Content(typeof(RegressionEnsembleSolution), false)]
     29  internal sealed partial class RegressionEnsembleSolutionModelView : DataAnalysisSolutionEvaluationView {
     30    private ModelsView view;
    4931
    50   [View("Ensemble Solutions")]
    51   [Content(typeof(IItemCollection<IRegressionSolution>), false)]
    52   internal sealed partial class RegressionEnsembleSolutionModelView : ItemCollectionView<IRegressionSolution> {
    5332    public RegressionEnsembleSolutionModelView() {
    5433      InitializeComponent();
     34      view = new ModelsView();
     35      view.Dock = DockStyle.Fill;
     36      Controls.Add(view);
    5537    }
    5638
    57     protected override void SetEnabledStateOfControls() {
    58       base.SetEnabledStateOfControls();
    59       addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked;
    60       removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0;
    61       itemsListView.Enabled = Content != null;
    62       detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
     39    public new RegressionEnsembleSolution Content {
     40      get { return (RegressionEnsembleSolution)base.Content; }
     41      set { base.Content = value; }
     42    }
     43
     44    protected override void OnContentChanged() {
     45      base.OnContentChanged();
     46      if (Content != null)
     47        view.Content = Content.RegressionSolutions;
     48      else
     49        view.Content = null;
     50    }
     51
     52    public override System.Drawing.Image ViewImage {
     53      get { return HeuristicLab.Common.Resources.VSImageLibrary.Properties; }
     54    }
     55
     56    private class ModelsView : ItemCollectionView<IRegressionSolution> {
     57      protected override void SetEnabledStateOfControls() {
     58        base.SetEnabledStateOfControls();
     59        addButton.Enabled = Content != null && !Content.IsReadOnly && !Locked;
     60        removeButton.Enabled = Content != null && !Content.IsReadOnly && !Locked && itemsListView.SelectedItems.Count > 0;
     61        itemsListView.Enabled = Content != null;
     62        detailsGroupBox.Enabled = Content != null && itemsListView.SelectedItems.Count == 1;
     63      }
    6364    }
    6465  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs

    r6628 r6642  
    11namespace HeuristicLab.Problems.DataAnalysis.Views {
    2   partial class DiscriminantFunctionClassificationRocCurvesView {
     2  partial class RegressionSolutionErrorCharacteristicsCurveView {
    33    /// <summary>
    44    /// Required designer variable.
     
    3030      this.label1 = new System.Windows.Forms.Label();
    3131      this.cmbSamples = new System.Windows.Forms.ComboBox();
    32       this.toolTip = new System.Windows.Forms.ToolTip(this.components);
    3332      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
    3433      this.SuspendLayout();
     
    3736      //
    3837      this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    39                   | System.Windows.Forms.AnchorStyles.Left)
    40                   | System.Windows.Forms.AnchorStyles.Right)));
     38            | System.Windows.Forms.AnchorStyles.Left)
     39            | System.Windows.Forms.AnchorStyles.Right)));
    4140      chartArea1.Name = "ChartArea1";
    4241      this.chart.ChartAreas.Add(chartArea1);
     
    4544      legend1.Name = "Legend1";
    4645      this.chart.Legends.Add(legend1);
    47       this.chart.Location = new System.Drawing.Point(0, 28);
     46      this.chart.Location = new System.Drawing.Point(6, 28);
    4847      this.chart.Name = "chart";
    4948      this.chart.Size = new System.Drawing.Size(366, 202);
    5049      this.chart.TabIndex = 0;
    5150      this.chart.Text = "chart";
    52       this.chart.CustomizeLegend += new System.EventHandler<System.Windows.Forms.DataVisualization.Charting.CustomizeLegendEventArgs>(this.chart_CustomizeLegend);
    53       this.chart.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart_MouseDown);
    54       this.chart.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart_MouseMove);
    5551      //
    5652      // label1
     
    7369      this.cmbSamples.SelectedIndexChanged += new System.EventHandler(this.cmbSamples_SelectedIndexChanged);
    7470      //
    75       // RocCurvesView
     71      // RegressionSolutionErrorCharacteristicsCurveView
    7672      //
    7773      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    8076      this.Controls.Add(this.cmbSamples);
    8177      this.Controls.Add(this.chart);
    82       this.Name = "RocCurvesView";
     78      this.Name = "RegressionSolutionErrorCharacteristicsCurveView";
    8379      this.Size = new System.Drawing.Size(366, 230);
    8480      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
     
    9086    #endregion
    9187
    92     private HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
    93     private System.Windows.Forms.Label label1;
    94     private System.Windows.Forms.ComboBox cmbSamples;
    95     private System.Windows.Forms.ToolTip toolTip;
    96 
     88    protected HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart chart;
     89    protected System.Windows.Forms.Label label1;
     90    protected System.Windows.Forms.ComboBox cmbSamples;
    9791  }
    9892}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs

    r6628 r6642  
    2222using System;
    2323using System.Collections.Generic;
    24 using System.Drawing;
    2524using System.Linq;
    26 using System.Text;
    2725using System.Windows.Forms;
    2826using System.Windows.Forms.DataVisualization.Charting;
    29 using HeuristicLab.Common;
    30 using HeuristicLab.Core.Views;
    3127using HeuristicLab.MainForm;
    3228using HeuristicLab.MainForm.WindowsForms;
    3329namespace HeuristicLab.Problems.DataAnalysis.Views {
    34   [View("ROC Curves")]
    35   [Content(typeof(IDiscriminantFunctionClassificationSolution))]
    36   public partial class DiscriminantFunctionClassificationRocCurvesView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {
    37     private const string xAxisTitle = "False Positive Rate";
    38     private const string yAxisTitle = "True Positive Rate";
    39     private const string TrainingSamples = "Training";
    40     private const string TestSamples = "Test";
    41     private Dictionary<string, List<ROCPoint>> cachedRocPoints;
    42 
    43     public DiscriminantFunctionClassificationRocCurvesView() {
     30  [View("Error Characteristics Curve")]
     31  [Content(typeof(IRegressionSolution))]
     32  public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView {
     33    protected const string TrainingSamples = "Training";
     34    protected const string TestSamples = "Test";
     35    protected const string AllSamples = "All Samples";
     36
     37    public RegressionSolutionErrorCharacteristicsCurveView()
     38      : base() {
    4439      InitializeComponent();
    45 
    46       cachedRocPoints = new Dictionary<string, List<ROCPoint>>();
    4740
    4841      cmbSamples.Items.Add(TrainingSamples);
    4942      cmbSamples.Items.Add(TestSamples);
     43      cmbSamples.Items.Add(AllSamples);
     44
    5045      cmbSamples.SelectedIndex = 0;
    5146
    5247      chart.CustomizeAllChartAreas();
     48      chart.ChartAreas[0].AxisX.Title = "Absolute Error";
    5349      chart.ChartAreas[0].AxisX.Minimum = 0.0;
    5450      chart.ChartAreas[0].AxisX.Maximum = 1.0;
    55       chart.ChartAreas[0].AxisX.MajorGrid.Interval = 0.2;
     51      chart.ChartAreas[0].AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount;
     52      chart.ChartAreas[0].CursorX.Interval = 0.01;
     53
     54      chart.ChartAreas[0].AxisY.Title = "Number of Samples";
    5655      chart.ChartAreas[0].AxisY.Minimum = 0.0;
    5756      chart.ChartAreas[0].AxisY.Maximum = 1.0;
    5857      chart.ChartAreas[0].AxisY.MajorGrid.Interval = 0.2;
    59 
    60       chart.ChartAreas[0].AxisX.Title = xAxisTitle;
    61       chart.ChartAreas[0].AxisY.Title = yAxisTitle;
    62     }
    63 
    64     public new IDiscriminantFunctionClassificationSolution Content {
    65       get { return (IDiscriminantFunctionClassificationSolution)base.Content; }
     58      chart.ChartAreas[0].CursorY.Interval = 0.01;
     59    }
     60
     61    public new IRegressionSolution Content {
     62      get { return (IRegressionSolution)base.Content; }
    6663      set { base.Content = value; }
     64    }
     65    public IRegressionProblemData ProblemData {
     66      get {
     67        if (Content == null) return null;
     68        return Content.ProblemData;
     69      }
    6770    }
    6871
     
    7881    }
    7982
    80     private void Content_ModelChanged(object sender, EventArgs e) {
    81       UpdateChart();
    82     }
    83     private void Content_ProblemDataChanged(object sender, EventArgs e) {
    84       UpdateChart();
    85     }
    86 
     83    protected virtual void Content_ModelChanged(object sender, EventArgs e) {
     84      if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ModelChanged, sender, e);
     85      else UpdateChart();
     86    }
     87    protected virtual void Content_ProblemDataChanged(object sender, EventArgs e) {
     88      if (InvokeRequired) Invoke((Action<object, EventArgs>)Content_ProblemDataChanged, sender, e);
     89      else {
     90        UpdateChart();
     91      }
     92    }
    8793    protected override void OnContentChanged() {
    8894      base.OnContentChanged();
     95      UpdateChart();
     96    }
     97
     98    protected virtual void UpdateChart() {
    8999      chart.Series.Clear();
    90       if (Content != null) UpdateChart();
    91     }
    92 
    93     private void UpdateChart() {
    94       if (InvokeRequired) Invoke((Action)UpdateChart);
    95       else {
    96         chart.Series.Clear();
    97         chart.Annotations.Clear();
    98         cachedRocPoints.Clear();
    99 
    100         int slices = 100;
    101         IEnumerable<int> rows;
    102 
    103         if (cmbSamples.SelectedItem.ToString() == TrainingSamples) {
    104           rows = Content.ProblemData.TrainingIndizes;
    105         } else if (cmbSamples.SelectedItem.ToString() == TestSamples) {
    106           rows = Content.ProblemData.TestIndizes;
    107         } else throw new InvalidOperationException();
    108 
    109         double[] estimatedValues = Content.GetEstimatedValues(rows).ToArray();
    110         double[] targetClassValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable, rows).ToArray();
    111         double minThreshold = estimatedValues.Min();
    112         double maxThreshold = estimatedValues.Max();
    113         double thresholdIncrement = (maxThreshold - minThreshold) / slices;
    114         minThreshold -= thresholdIncrement;
    115         maxThreshold += thresholdIncrement;
    116 
    117         List<double> classValues = Content.ProblemData.ClassValues.OrderBy(x => x).ToList();
    118 
    119         foreach (double classValue in classValues) {
    120           List<ROCPoint> rocPoints = new List<ROCPoint>();
    121           int positives = targetClassValues.Where(c => c.IsAlmost(classValue)).Count();
    122           int negatives = targetClassValues.Length - positives;
    123 
    124           for (double lowerThreshold = minThreshold; lowerThreshold < maxThreshold; lowerThreshold += thresholdIncrement) {
    125             for (double upperThreshold = lowerThreshold + thresholdIncrement; upperThreshold < maxThreshold; upperThreshold += thresholdIncrement) {
    126               //only adapt lower threshold for binary classification problems and upper class prediction             
    127               if (classValues.Count == 2 && classValue == classValues[1]) upperThreshold = double.PositiveInfinity;
    128 
    129               int truePositives = 0;
    130               int falsePositives = 0;
    131 
    132               for (int row = 0; row < estimatedValues.Length; row++) {
    133                 if (lowerThreshold < estimatedValues[row] && estimatedValues[row] < upperThreshold) {
    134                   if (targetClassValues[row].IsAlmost(classValue)) truePositives++;
    135                   else falsePositives++;
    136                 }
    137               }
    138 
    139               double truePositiveRate = ((double)truePositives) / positives;
    140               double falsePositiveRate = ((double)falsePositives) / negatives;
    141 
    142               ROCPoint rocPoint = new ROCPoint(truePositiveRate, falsePositiveRate, lowerThreshold, upperThreshold);
    143               if (!rocPoints.Any(x => x.truePositiveRate >= rocPoint.truePositiveRate && x.falsePositiveRate <= rocPoint.falsePositiveRate)) {
    144                 rocPoints.RemoveAll(x => x.falsePositiveRate >= rocPoint.falsePositiveRate && x.truePositiveRate <= rocPoint.truePositiveRate);
    145                 rocPoints.Add(rocPoint);
    146               }
    147             }
    148             //only adapt upper threshold for binary classification problems and upper class prediction             
    149             if (classValues.Count == 2 && classValue == classValues[0]) lowerThreshold = double.PositiveInfinity;
    150           }
    151 
    152           string className = Content.ProblemData.ClassNames.ElementAt(classValues.IndexOf(classValue));
    153           cachedRocPoints[className] = rocPoints.OrderBy(x => x.falsePositiveRate).ToList(); ;
    154 
    155           Series series = new Series(className);
    156           series.ChartType = SeriesChartType.Line;
    157           series.MarkerStyle = MarkerStyle.Diamond;
    158           series.MarkerSize = 5;
    159           chart.Series.Add(series);
    160           FillSeriesWithDataPoints(series, cachedRocPoints[className]);
    161 
    162           double auc = CalculateAreaUnderCurve(series);
    163           series.LegendToolTip = "AUC: " + auc;
     100      chart.Annotations.Clear();
     101      if (Content == null) return;
     102
     103      var originalValues = GetOriginalValues();
     104      var meanModelEstimatedValues = GetMeanModelEstimatedValues(originalValues);
     105      var meanModelResiduals = GetResiduals(originalValues, meanModelEstimatedValues);
     106
     107      meanModelResiduals.Sort();
     108      chart.ChartAreas[0].AxisX.Maximum = Math.Ceiling(meanModelResiduals.Last());
     109      chart.ChartAreas[0].CursorX.Interval = meanModelResiduals.First() / 100;
     110
     111      Series meanModelSeries = new Series("Mean Model");
     112      meanModelSeries.ChartType = SeriesChartType.FastLine;
     113      UpdateSeries(meanModelResiduals, meanModelSeries);
     114      meanModelSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(meanModelSeries);
     115      chart.Series.Add(meanModelSeries);
     116
     117      AddRegressionSolution(Content);
     118    }
     119
     120    protected void AddRegressionSolution(IRegressionSolution solution) {
     121      if (chart.Series.Any(s => s.Name == solution.Name)) return;
     122
     123      Series solutionSeries = new Series(solution.Name);
     124      solutionSeries.Tag = solution;
     125      solutionSeries.ChartType = SeriesChartType.FastLine;
     126      var estimatedValues = GetResiduals(GetOriginalValues(), GetEstimatedValues(solution));
     127      UpdateSeries(estimatedValues, solutionSeries);
     128      solutionSeries.ToolTip = "Area over Curve: " + CalculateAreaOverCurve(solutionSeries);
     129      chart.Series.Add(solutionSeries);
     130    }
     131
     132    protected void UpdateSeries(List<double> residuals, Series series) {
     133      series.Points.Clear();
     134      residuals.Sort();
     135
     136      series.Points.AddXY(0, 0);
     137      for (int i = 0; i < residuals.Count; i++) {
     138        var point = new DataPoint();
     139        if (residuals[i] > chart.ChartAreas[0].AxisX.Maximum) {
     140          point.XValue = chart.ChartAreas[0].AxisX.Maximum;
     141          point.YValues[0] = ((double)i - 1) / residuals.Count;
     142          point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0];
     143          series.Points.Add(point);
     144          break;
    164145        }
    165       }
    166     }
    167 
    168     private void FillSeriesWithDataPoints(Series series, IEnumerable<ROCPoint> rocPoints) {
    169       series.Points.Add(new DataPoint(0, 0));
    170       foreach (ROCPoint rocPoint in rocPoints) {
    171         DataPoint point = new DataPoint();
    172         point.XValue = rocPoint.falsePositiveRate;
    173         point.YValues[0] = rocPoint.truePositiveRate;
    174         point.Tag = rocPoint;
    175 
    176         StringBuilder sb = new StringBuilder();
    177         sb.AppendLine("True Positive Rate: " + rocPoint.truePositiveRate);
    178         sb.AppendLine("False Positive Rate: " + rocPoint.falsePositiveRate);
    179         sb.AppendLine("Upper Threshold: " + rocPoint.upperThreshold);
    180         sb.AppendLine("Lower Threshold: " + rocPoint.lowerThreshold);
    181         point.ToolTip = sb.ToString();
    182 
     146
     147        point.XValue = residuals[i];
     148        point.YValues[0] = ((double)i) / residuals.Count;
     149        point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0];
    183150        series.Points.Add(point);
    184151      }
    185       series.Points.Add(new DataPoint(1, 1));
    186     }
    187 
    188     private double CalculateAreaUnderCurve(Series series) {
     152
     153      if (series.Points.Last().XValue < chart.ChartAreas[0].AxisX.Maximum) {
     154        var point = new DataPoint();
     155        point.XValue = chart.ChartAreas[0].AxisX.Maximum;
     156        point.YValues[0] = 1;
     157        point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0];
     158        series.Points.Add(point);
     159      }
     160    }
     161
     162    protected IEnumerable<double> GetOriginalValues() {
     163      IEnumerable<double> originalValues;
     164      switch (cmbSamples.SelectedItem.ToString()) {
     165        case TrainingSamples:
     166          originalValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes);
     167          break;
     168        case TestSamples:
     169          originalValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TestIndizes);
     170          break;
     171        case AllSamples:
     172          originalValues = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable);
     173          break;
     174        default:
     175          throw new NotSupportedException();
     176      }
     177      return originalValues;
     178    }
     179
     180    protected IEnumerable<double> GetEstimatedValues(IRegressionSolution solution) {
     181      IEnumerable<double> estimatedValues;
     182      switch (cmbSamples.SelectedItem.ToString()) {
     183        case TrainingSamples:
     184          estimatedValues = solution.EstimatedTrainingValues;
     185          break;
     186        case TestSamples:
     187          estimatedValues = solution.EstimatedTestValues;
     188          break;
     189        case AllSamples:
     190          estimatedValues = solution.EstimatedValues;
     191          break;
     192        default:
     193          throw new NotSupportedException();
     194      }
     195      return estimatedValues;
     196    }
     197
     198    protected IEnumerable<double> GetMeanModelEstimatedValues(IEnumerable<double> originalValues) {
     199      double averageTrainingTarget = ProblemData.Dataset.GetEnumeratedVariableValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();
     200      return Enumerable.Repeat(averageTrainingTarget, originalValues.Count());
     201    }
     202
     203    protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) {
     204      return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
     205    }
     206
     207    private double CalculateAreaOverCurve(Series series) {
    189208      if (series.Points.Count < 1) throw new ArgumentException("Could not calculate area under curve if less than 1 data points were given.");
    190209
     
    192211      for (int i = 1; i < series.Points.Count; i++) {
    193212        double width = series.Points[i].XValue - series.Points[i - 1].XValue;
    194         double y1 = series.Points[i - 1].YValues[0];
    195         double y2 = series.Points[i].YValues[0];
     213        double y1 = 1 - series.Points[i - 1].YValues[0];
     214        double y2 = 1 - series.Points[i].YValues[0];
    196215
    197216        auc += (y1 + y2) * width / 2;
     
    201220    }
    202221
    203     private void cmbSamples_SelectedIndexChanged(object sender, System.EventArgs e) {
    204       if (Content != null)
    205         UpdateChart();
    206     }
    207 
    208 
    209     #region show / hide series
    210     private void ToggleSeries(Series series) {
    211       if (series.Points.Count == 0)
    212         FillSeriesWithDataPoints(series, cachedRocPoints[series.Name]);
    213       else
    214         series.Points.Clear();
    215     }
    216     private void chart_MouseDown(object sender, MouseEventArgs e) {
    217       HitTestResult result = chart.HitTest(e.X, e.Y);
    218       if (result.ChartElementType == ChartElementType.LegendItem) {
    219         if (result.Series != null) ToggleSeries(result.Series);
    220       }
    221     }
    222     private void chart_CustomizeLegend(object sender, CustomizeLegendEventArgs e) {
    223       foreach (LegendItem legendItem in e.LegendItems) {
    224         var series = chart.Series[legendItem.SeriesName];
    225         if (series != null) {
    226           bool seriesIsInvisible = series.Points.Count == 0;
    227           foreach (LegendCell cell in legendItem.Cells)
    228             cell.ForeColor = seriesIsInvisible ? Color.Gray : Color.Black;
    229         }
    230       }
    231     }
    232     private void chart_MouseMove(object sender, MouseEventArgs e) {
    233       HitTestResult result = chart.HitTest(e.X, e.Y);
    234       if (result.ChartElementType == ChartElementType.LegendItem)
    235         this.Cursor = Cursors.Hand;
    236       else
    237         this.Cursor = Cursors.Default;
    238 
    239       string newTooltipText = string.Empty;
    240       if (result.ChartElementType == ChartElementType.DataPoint)
    241         newTooltipText = ((DataPoint)result.Object).ToolTip;
    242 
    243       string oldTooltipText = this.toolTip.GetToolTip(chart);
    244       if (newTooltipText != oldTooltipText)
    245         this.toolTip.SetToolTip(chart, newTooltipText);
    246     }
    247     #endregion
    248 
    249 
    250     private class ROCPoint {
    251       public ROCPoint(double truePositiveRate, double falsePositiveRate, double lowerThreshold, double upperThreshold) {
    252         this.truePositiveRate = truePositiveRate;
    253         this.falsePositiveRate = falsePositiveRate;
    254         this.lowerThreshold = lowerThreshold;
    255         this.upperThreshold = upperThreshold;
    256 
    257       }
    258       public double truePositiveRate { get; private set; }
    259       public double falsePositiveRate { get; private set; }
    260       public double lowerThreshold { get; private set; }
    261       public double upperThreshold { get; private set; }
    262     }
    263 
     222    protected void cmbSamples_SelectedIndexChanged(object sender, EventArgs e) {
     223      if (InvokeRequired) Invoke((Action<object, EventArgs>)cmbSamples_SelectedIndexChanged, sender, e);
     224      else UpdateChart();
     225    }
    264226  }
    265227}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs

    r6255 r6642  
    2222using System.Linq;
    2323using System.Windows.Forms;
    24 using HeuristicLab.Core.Views;
    2524using HeuristicLab.Data;
    2625using HeuristicLab.Data.Views;
    2726using HeuristicLab.MainForm;
    2827using HeuristicLab.MainForm.WindowsForms;
    29 using System.Globalization;
    3028
    3129namespace HeuristicLab.Problems.DataAnalysis.Views {
    3230  [View("Estimated Values")]
    3331  [Content(typeof(IRegressionSolution))]
    34   public partial class RegressionSolutionEstimatedValuesView : ItemView, IRegressionSolutionEvaluationView {
     32  public partial class RegressionSolutionEstimatedValuesView : DataAnalysisSolutionEvaluationView {
    3533    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
    3634    private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Values (all)";
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs

    r6520 r6642  
    2424using System.Windows.Forms;
    2525using System.Windows.Forms.DataVisualization.Charting;
    26 using HeuristicLab.Core.Views;
    2726using HeuristicLab.MainForm;
    2827using HeuristicLab.MainForm.WindowsForms;
     
    3130  [View("Line Chart")]
    3231  [Content(typeof(IRegressionSolution))]
    33   public partial class RegressionSolutionLineChartView : ItemView, IRegressionSolutionEvaluationView {
     32  public partial class RegressionSolutionLineChartView : DataAnalysisSolutionEvaluationView {
    3433    private const string TARGETVARIABLE_SERIES_NAME = "Target Variable";
    3534    private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Values (training)";
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs

    r6238 r6642  
    2525using System.Windows.Forms;
    2626using System.Windows.Forms.DataVisualization.Charting;
    27 using HeuristicLab.Core.Views;
    2827using HeuristicLab.MainForm;
    2928using HeuristicLab.MainForm.WindowsForms;
     
    3231  [View("Scatter Plot")]
    3332  [Content(typeof(IRegressionSolution))]
    34   public partial class RegressionSolutionScatterPlotView : ItemView, IRegressionSolutionEvaluationView {
     33  public partial class RegressionSolutionScatterPlotView : DataAnalysisSolutionEvaluationView {
    3534    private const string ALL_SERIES = "All samples";
    3635    private const string TRAINING_SERIES = "Training samples";
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.Designer.cs

    r6596 r6642  
    4747      components = new System.ComponentModel.Container();
    4848      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     49      this.itemsGroupBox.Text = "Classification Solution";
    4950    }
    5051
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs

    r6612 r6642  
    2020#endregion
    2121
    22 using System;
    2322using System.Windows.Forms;
    2423using HeuristicLab.MainForm;
    25 using HeuristicLab.PluginInfrastructure;
    2624
    2725namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3129    public ClassificationSolutionView() {
    3230      InitializeComponent();
    33 
    34       var classificationSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IClassificationSolutionEvaluationView), true);
    35       foreach (Type viewType in classificationSolutionEvaluationViewTypes)
    36         AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
    3731    }
    3832
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs

    r6612 r6642  
    2020#endregion
    2121
    22 using System;
    2322using System.Windows.Forms;
    2423using HeuristicLab.MainForm;
    25 using HeuristicLab.PluginInfrastructure;
    2624
    2725namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3129    public ClusteringSolutionView() {
    3230      InitializeComponent();
    33 
    34       var clusteringSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IClusteringSolutionEvaluationView), true);
    35       foreach (Type viewType in clusteringSolutionEvaluationViewTypes)
    36         AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
    3731    }
    3832
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs

    r6612 r6642  
    4646        selectedName = itemsListView.SelectedItems[0].Text;
    4747
    48       //cache old viewTypes;
    49       var viewTypes = new List<Tuple<Type, Image>>();
    50       foreach (ListViewItem item in ItemsListView.Items) {
    51         var viewType = item.Tag as Type;
    52         if (viewType != null) viewTypes.Add(Tuple.Create(viewType, imageList.Images[item.ImageIndex]));
    53       }
    54 
    5548      base.OnContentChanged();
    56 
    57       //readd viewTypes
    58       foreach (var tuple in viewTypes)
    59         AddViewListViewItem(tuple.Item1, tuple.Item2);
     49      AddEvaluationViewTypes();
    6050
    6151      //recover selection
     
    6555            item.Selected = true;
    6656        }
     57      }
     58    }
     59
     60    protected virtual void AddEvaluationViewTypes() {
     61      if (Content != null) {
     62        var viewTypes = MainFormManager.GetViewTypes(Content.GetType(), true)
     63          .Where(t => typeof(IDataAnalysisSolutionEvaluationView).IsAssignableFrom(t));
     64        foreach (var viewType in viewTypes)
     65          AddViewListViewItem(viewType, ((IDataAnalysisSolutionEvaluationView)Activator.CreateInstance(viewType)).ViewImage);
    6766      }
    6867    }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs

    r6612 r6642  
    2020#endregion
    2121
    22 using System;
    2322using System.Windows.Forms;
    2423using HeuristicLab.MainForm;
    25 using HeuristicLab.PluginInfrastructure;
    2624
    2725namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3129    public DiscriminantFunctionClassificationSolutionView() {
    3230      InitializeComponent();
    33 
    34       var classificationSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IClassificationSolutionEvaluationView), true);
    35       foreach (Type viewType in classificationSolutionEvaluationViewTypes)
    36         AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
    37       RemoveViewListViewItem(typeof(ClassificationSolutionEstimatedClassValuesView));
    38 
    39       var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IDiscriminantFunctionClassificationSolutionEvaluationView), true);
    40       foreach (Type viewType in regressionSolutionEvaluationViewTypes)
    41         AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
    4231    }
    4332
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs

    r6612 r6642  
    2020#endregion
    2121
    22 using System;
    2322using System.Windows.Forms;
    2423using HeuristicLab.MainForm;
    25 using HeuristicLab.PluginInfrastructure;
    2624
    2725namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    3129    public RegressionSolutionView() {
    3230      InitializeComponent();
    33 
    34       var regressionSolutionEvaluationViewTypes = ApplicationManager.Manager.GetTypes(typeof(IRegressionSolutionEvaluationView), true);
    35       foreach (Type viewType in regressionSolutionEvaluationViewTypes)
    36         AddViewListViewItem(viewType, HeuristicLab.Common.Resources.VSImageLibrary.Graph);
    3731    }
    3832
Note: See TracChangeset for help on using the changeset viewer.