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/Classification
Files:
6 edited

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;
Note: See TracChangeset for help on using the changeset viewer.