Changeset 6642
- Timestamp:
- 08/08/11 13:15:23 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 added
- 6 deleted
- 20 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.csproj
r6256 r6642 117 117 <DependentUpon>InteractiveSymbolicRegressionSolutionSimplifierView.cs</DependentUpon> 118 118 </Compile> 119 <Compile Include="SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs"> 120 <SubType>UserControl</SubType> 121 </Compile> 122 <Compile Include="SymbolicRegressionSolutionErrorCharacteristicsCurveView.Designer.cs"> 123 <DependentUpon>SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs</DependentUpon> 124 </Compile> 119 125 <Compile Include="SymbolicRegressionSolutionView.cs"> 120 126 <SubType>UserControl</SubType> … … 129 135 </ItemGroup> 130 136 <ItemGroup> 137 <ProjectReference Include="..\..\HeuristicLab.Algorithms.DataAnalysis\3.4\HeuristicLab.Algorithms.DataAnalysis-3.4.csproj"> 138 <Project>{2E782078-FA81-4B70-B56F-74CE38DAC6C8}</Project> 139 <Name>HeuristicLab.Algorithms.DataAnalysis-3.4</Name> 140 </ProjectReference> 131 141 <ProjectReference Include="..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj"> 132 142 <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project> … … 208 218 <Project>{DF87C13E-A889-46FF-8153-66DCAA8C5674}</Project> 209 219 <Name>HeuristicLab.Problems.DataAnalysis-3.4</Name> 220 </ProjectReference> 221 <ProjectReference Include="..\..\HeuristicLab.Visualization.ChartControlsExtensions\3.3\HeuristicLab.Visualization.ChartControlsExtensions-3.3.csproj"> 222 <Project>{315BDA09-3F4F-49B3-9790-B37CFC1C5750}</Project> 223 <Name>HeuristicLab.Visualization.ChartControlsExtensions-3.3</Name> 210 224 </ProjectReference> 211 225 </ItemGroup> -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/HeuristicLabProblemsDataAnalysisSymbolicRegressionViewsPlugin.cs.frame
r6548 r6642 28 28 [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views", "Provides views for symbolic regression problem classes.", "3.4.1.$WCREV$")] 29 29 [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views-3.4.dll",PluginFileType.Assembly)] 30 [PluginDependency("HeuristicLab.Algorithms.DataAnalysis", "3.4")] 31 [PluginDependency("HeuristicLab.Collections", "3.3")] 30 32 [PluginDependency("HeuristicLab.Common", "3.3")] 31 33 [PluginDependency("HeuristicLab.Core", "3.3")] … … 41 43 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic.Views", "3.4")] 42 44 [PluginDependency("HeuristicLab.Problems.DataAnalysis.Views", "3.4")] 45 [PluginDependency("HeuristicLab.Visualization.ChartControlsExtensions", "3.3")] 43 46 public class HeuristicLabProblemsDataAnalysisSymbolicRegressionViewsPlugin : PluginBase { 44 47 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionModelView.cs
r6613 r6642 19 19 */ 20 20 #endregion 21 21 using System.Windows.Forms; 22 using HeuristicLab.Core.Views; 23 using HeuristicLab.MainForm; 24 using HeuristicLab.MainForm.WindowsForms; 22 25 23 26 namespace 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; 49 31 50 [View("Ensemble Solutions")]51 [Content(typeof(IItemCollection<IClassificationSolution>), false)]52 internal sealed partial class ClassificationEnsembleSolutionModelView : ItemCollectionView<IClassificationSolution> {53 32 public ClassificationEnsembleSolutionModelView() { 54 33 InitializeComponent(); 34 view = new ModelsView(); 35 view.Dock = DockStyle.Fill; 36 Controls.Add(view); 55 37 } 56 38 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 } 63 64 } 64 65 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionConfusionMatrixView.cs
r6520 r6642 24 24 using System.Linq; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Core.Views;27 26 using HeuristicLab.MainForm; 28 27 using HeuristicLab.MainForm.WindowsForms; … … 31 30 [View("Confusion Matrix")] 32 31 [Content(typeof(IClassificationSolution))] 33 public partial class ClassificationSolutionConfusionMatrixView : ItemView, IClassificationSolutionEvaluationView {32 public partial class ClassificationSolutionConfusionMatrixView : DataAnalysisSolutionEvaluationView { 34 33 private const string TrainingSamples = "Training"; 35 34 private const string TestSamples = "Test"; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionEstimatedClassValuesView.cs
r6255 r6642 22 22 using System.Linq; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Core.Views;25 24 using HeuristicLab.Data; 26 25 using HeuristicLab.Data.Views; … … 31 30 [View("Estimated Class Values")] 32 31 [Content(typeof(IClassificationSolution))] 33 public partial class ClassificationSolutionEstimatedClassValuesView : ItemView, IClassificationSolutionEvaluationView {32 public partial class ClassificationSolutionEstimatedClassValuesView : DataAnalysisSolutionEvaluationView { 34 33 private const string TARGETVARIABLE_SERIES_NAME = "Target Variable"; 35 34 private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Class Values (all)"; … … 39 38 public new IClassificationSolution Content { 40 39 get { return (IClassificationSolution)base.Content; } 41 set { 42 base.Content = value; 43 } 40 set { base.Content = value; } 44 41 } 45 42 46 pr ivateStringConvertibleMatrixView matrixView;43 protected StringConvertibleMatrixView matrixView; 47 44 48 45 public ClassificationSolutionEstimatedClassValuesView() … … 82 79 } 83 80 84 pr ivatevoid UpdateEstimatedValues() {81 protected virtual void UpdateEstimatedValues() { 85 82 if (InvokeRequired) Invoke((Action)UpdateEstimatedValues); 86 83 else { … … 111 108 112 109 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 }; 114 111 matrix.SortableView = true; 115 112 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationRocCurvesView.cs
r5975 r6642 28 28 using System.Windows.Forms.DataVisualization.Charting; 29 29 using HeuristicLab.Common; 30 using HeuristicLab.Core.Views;31 30 using HeuristicLab.MainForm; 32 31 using HeuristicLab.MainForm.WindowsForms; … … 34 33 [View("ROC Curves")] 35 34 [Content(typeof(IDiscriminantFunctionClassificationSolution))] 36 public partial class DiscriminantFunctionClassificationRocCurvesView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {35 public partial class DiscriminantFunctionClassificationRocCurvesView : DataAnalysisSolutionEvaluationView { 37 36 private const string xAxisTitle = "False Positive Rate"; 38 37 private const string yAxisTitle = "True Positive Rate"; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionEstimatedClassValuesView.cs
r6411 r6642 22 22 using System.Linq; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Core.Views;25 24 using HeuristicLab.Data; 26 using HeuristicLab.Data.Views;27 25 using HeuristicLab.MainForm; 28 26 using HeuristicLab.MainForm.WindowsForms; … … 31 29 [View("Estimated Class Values")] 32 30 [Content(typeof(IDiscriminantFunctionClassificationSolution))] 33 public partial class DiscriminantFunctionClassificationSolutionEstimatedClassValuesView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {31 public partial class DiscriminantFunctionClassificationSolutionEstimatedClassValuesView : ClassificationSolutionEstimatedClassValuesView { 34 32 private const string TargetClassValuesSeriesname = "TargetVariable"; 35 33 private const string EstimatedClassValuesSeriesName = "EstimatedClassValues"; … … 38 36 public new IDiscriminantFunctionClassificationSolution Content { 39 37 get { return (IDiscriminantFunctionClassificationSolution)base.Content; } 40 set { 41 base.Content = value; 42 } 38 set { base.Content = value; } 43 39 } 44 45 private StringConvertibleMatrixView matrixView;46 40 47 41 public DiscriminantFunctionClassificationSolutionEstimatedClassValuesView() 48 42 : base() { 49 43 InitializeComponent(); 50 matrixView = new StringConvertibleMatrixView();51 matrixView.ShowRowsAndColumnsTextBox = false;52 matrixView.ShowStatisticalInformation = false;53 matrixView.Dock = DockStyle.Fill;54 this.Controls.Add(matrixView);55 44 } 56 45 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() { 84 47 if (InvokeRequired) Invoke((Action)UpdateEstimatedValues); 85 48 else { … … 105 68 } 106 69 } 107 #endregion108 70 } 109 71 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs
r5975 r6642 27 27 using System.Windows.Forms.DataVisualization.Charting; 28 28 using HeuristicLab.Common; 29 using HeuristicLab.Core.Views;30 29 using HeuristicLab.MainForm; 31 30 using HeuristicLab.MainForm.WindowsForms; … … 34 33 [View("Classification Threshold")] 35 34 [Content(typeof(IDiscriminantFunctionClassificationSolution), true)] 36 public sealed partial class DiscriminantFunctionClassificationSolutionThresholdView : ItemView, IDiscriminantFunctionClassificationSolutionEvaluationView {35 public sealed partial class DiscriminantFunctionClassificationSolutionThresholdView : DataAnalysisSolutionEvaluationView { 37 36 private const double TrainingAxisValue = 0.0; 38 37 private const double TestAxisValue = 10.0; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Clustering/ClusteringSolutionEstimatedClusterView.cs
r6003 r6642 22 22 using System.Linq; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Core.Views;25 24 using HeuristicLab.Data; 26 25 using HeuristicLab.Data.Views; … … 31 30 [View("Estimated Clusters")] 32 31 [Content(typeof(IClusteringSolution))] 33 public partial class ClusteringSolutionEstimatedClusterView : ItemView, IClusteringSolutionEvaluationView {32 public partial class ClusteringSolutionEstimatedClusterView : DataAnalysisSolutionEvaluationView { 34 33 private const string CLUSTER_NAMES = "Cluster"; 35 34 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r6613 r6642 116 116 <DependentUpon>ClassificationEnsembleSolutionModelView.cs</DependentUpon> 117 117 </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> 118 130 <Compile Include="Regression\RegressionEnsembleSolutionModelView.cs"> 119 131 <SubType>UserControl</SubType> … … 170 182 <DependentUpon>ClusteringSolutionView.cs</DependentUpon> 171 183 </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>178 184 <Compile Include="Solution Views\DiscriminantFunctionClassificationSolutionView.cs"> 179 185 <SubType>UserControl</SubType> … … 182 188 <DependentUpon>DiscriminantFunctionClassificationSolutionView.cs</DependentUpon> 183 189 </Compile> 184 <Compile Include="Interfaces\IDiscriminantFunctionClassificationSolutionEvaluationView.cs" />185 <Compile Include="Interfaces\IClusteringSolutionEvaluationView.cs" />186 <Compile Include="Interfaces\IClassificationSolutionEvaluationView.cs" />187 190 <Compile Include="Solution Views\DataAnalysisSolutionView.cs"> 188 191 <SubType>UserControl</SubType> … … 197 200 <DependentUpon>DoubleLimitView.cs</DependentUpon> 198 201 </Compile> 199 <Compile Include="Interfaces\I RegressionSolutionEvaluationView.cs" />202 <Compile Include="Interfaces\IDataAnalysisSolutionEvaluationView.cs" /> 200 203 <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>207 204 <Compile Include="Solution Views\RegressionSolutionView.cs"> 208 205 <SubType>UserControl</SubType> … … 336 333 </BootstrapperPackage> 337 334 </ItemGroup> 338 <ItemGroup />339 335 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 340 336 <!-- 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 21 21 22 22 23 using System.Drawing; 24 using HeuristicLab.MainForm; 23 25 namespace HeuristicLab.Problems.DataAnalysis.Views { 24 public interface I RegressionSolutionEvaluationView {25 new IRegressionSolution Content { get; set; }26 public interface IDataAnalysisSolutionEvaluationView :IContentView { 27 Image ViewImage { get; } 26 28 } 27 29 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionEnsembleSolutionModelView.cs
r6612 r6642 19 19 */ 20 20 #endregion 21 21 using System.Windows.Forms; 22 using HeuristicLab.Core.Views; 23 using HeuristicLab.MainForm; 24 using HeuristicLab.MainForm.WindowsForms; 22 25 23 26 namespace 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; 49 31 50 [View("Ensemble Solutions")]51 [Content(typeof(IItemCollection<IRegressionSolution>), false)]52 internal sealed partial class RegressionEnsembleSolutionModelView : ItemCollectionView<IRegressionSolution> {53 32 public RegressionEnsembleSolutionModelView() { 54 33 InitializeComponent(); 34 view = new ModelsView(); 35 view.Dock = DockStyle.Fill; 36 Controls.Add(view); 55 37 } 56 38 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 } 63 64 } 64 65 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.Designer.cs
r6628 r6642 1 1 namespace HeuristicLab.Problems.DataAnalysis.Views { 2 partial class DiscriminantFunctionClassificationRocCurvesView {2 partial class RegressionSolutionErrorCharacteristicsCurveView { 3 3 /// <summary> 4 4 /// Required designer variable. … … 30 30 this.label1 = new System.Windows.Forms.Label(); 31 31 this.cmbSamples = new System.Windows.Forms.ComboBox(); 32 this.toolTip = new System.Windows.Forms.ToolTip(this.components);33 32 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); 34 33 this.SuspendLayout(); … … 37 36 // 38 37 this.chart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 39 40 38 | System.Windows.Forms.AnchorStyles.Left) 39 | System.Windows.Forms.AnchorStyles.Right))); 41 40 chartArea1.Name = "ChartArea1"; 42 41 this.chart.ChartAreas.Add(chartArea1); … … 45 44 legend1.Name = "Legend1"; 46 45 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); 48 47 this.chart.Name = "chart"; 49 48 this.chart.Size = new System.Drawing.Size(366, 202); 50 49 this.chart.TabIndex = 0; 51 50 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);55 51 // 56 52 // label1 … … 73 69 this.cmbSamples.SelectedIndexChanged += new System.EventHandler(this.cmbSamples_SelectedIndexChanged); 74 70 // 75 // R ocCurvesView71 // RegressionSolutionErrorCharacteristicsCurveView 76 72 // 77 73 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); … … 80 76 this.Controls.Add(this.cmbSamples); 81 77 this.Controls.Add(this.chart); 82 this.Name = "R ocCurvesView";78 this.Name = "RegressionSolutionErrorCharacteristicsCurveView"; 83 79 this.Size = new System.Drawing.Size(366, 230); 84 80 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); … … 90 86 #endregion 91 87 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; 97 91 } 98 92 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r6628 r6642 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing;25 24 using System.Linq; 26 using System.Text;27 25 using System.Windows.Forms; 28 26 using System.Windows.Forms.DataVisualization.Charting; 29 using HeuristicLab.Common;30 using HeuristicLab.Core.Views;31 27 using HeuristicLab.MainForm; 32 28 using HeuristicLab.MainForm.WindowsForms; 33 29 namespace 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() { 44 39 InitializeComponent(); 45 46 cachedRocPoints = new Dictionary<string, List<ROCPoint>>();47 40 48 41 cmbSamples.Items.Add(TrainingSamples); 49 42 cmbSamples.Items.Add(TestSamples); 43 cmbSamples.Items.Add(AllSamples); 44 50 45 cmbSamples.SelectedIndex = 0; 51 46 52 47 chart.CustomizeAllChartAreas(); 48 chart.ChartAreas[0].AxisX.Title = "Absolute Error"; 53 49 chart.ChartAreas[0].AxisX.Minimum = 0.0; 54 50 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"; 56 55 chart.ChartAreas[0].AxisY.Minimum = 0.0; 57 56 chart.ChartAreas[0].AxisY.Maximum = 1.0; 58 57 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; } 66 63 set { base.Content = value; } 64 } 65 public IRegressionProblemData ProblemData { 66 get { 67 if (Content == null) return null; 68 return Content.ProblemData; 69 } 67 70 } 68 71 … … 78 81 } 79 82 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 } 87 93 protected override void OnContentChanged() { 88 94 base.OnContentChanged(); 95 UpdateChart(); 96 } 97 98 protected virtual void UpdateChart() { 89 99 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; 164 145 } 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]; 183 150 series.Points.Add(point); 184 151 } 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) { 189 208 if (series.Points.Count < 1) throw new ArgumentException("Could not calculate area under curve if less than 1 data points were given."); 190 209 … … 192 211 for (int i = 1; i < series.Points.Count; i++) { 193 212 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]; 196 215 197 216 auc += (y1 + y2) * width / 2; … … 201 220 } 202 221 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 } 264 226 } 265 227 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs
r6255 r6642 22 22 using System.Linq; 23 23 using System.Windows.Forms; 24 using HeuristicLab.Core.Views;25 24 using HeuristicLab.Data; 26 25 using HeuristicLab.Data.Views; 27 26 using HeuristicLab.MainForm; 28 27 using HeuristicLab.MainForm.WindowsForms; 29 using System.Globalization;30 28 31 29 namespace HeuristicLab.Problems.DataAnalysis.Views { 32 30 [View("Estimated Values")] 33 31 [Content(typeof(IRegressionSolution))] 34 public partial class RegressionSolutionEstimatedValuesView : ItemView, IRegressionSolutionEvaluationView {32 public partial class RegressionSolutionEstimatedValuesView : DataAnalysisSolutionEvaluationView { 35 33 private const string TARGETVARIABLE_SERIES_NAME = "Target Variable"; 36 34 private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Values (all)"; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs
r6520 r6642 24 24 using System.Windows.Forms; 25 25 using System.Windows.Forms.DataVisualization.Charting; 26 using HeuristicLab.Core.Views;27 26 using HeuristicLab.MainForm; 28 27 using HeuristicLab.MainForm.WindowsForms; … … 31 30 [View("Line Chart")] 32 31 [Content(typeof(IRegressionSolution))] 33 public partial class RegressionSolutionLineChartView : ItemView, IRegressionSolutionEvaluationView {32 public partial class RegressionSolutionLineChartView : DataAnalysisSolutionEvaluationView { 34 33 private const string TARGETVARIABLE_SERIES_NAME = "Target Variable"; 35 34 private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Values (training)"; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r6238 r6642 25 25 using System.Windows.Forms; 26 26 using System.Windows.Forms.DataVisualization.Charting; 27 using HeuristicLab.Core.Views;28 27 using HeuristicLab.MainForm; 29 28 using HeuristicLab.MainForm.WindowsForms; … … 32 31 [View("Scatter Plot")] 33 32 [Content(typeof(IRegressionSolution))] 34 public partial class RegressionSolutionScatterPlotView : ItemView, IRegressionSolutionEvaluationView {33 public partial class RegressionSolutionScatterPlotView : DataAnalysisSolutionEvaluationView { 35 34 private const string ALL_SERIES = "All samples"; 36 35 private const string TRAINING_SERIES = "Training samples"; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.Designer.cs
r6596 r6642 47 47 components = new System.ComponentModel.Container(); 48 48 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 49 this.itemsGroupBox.Text = "Classification Solution"; 49 50 } 50 51 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClassificationSolutionView.cs
r6612 r6642 20 20 #endregion 21 21 22 using System;23 22 using System.Windows.Forms; 24 23 using HeuristicLab.MainForm; 25 using HeuristicLab.PluginInfrastructure;26 24 27 25 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 31 29 public ClassificationSolutionView() { 32 30 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 31 } 38 32 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/ClusteringSolutionView.cs
r6612 r6642 20 20 #endregion 21 21 22 using System;23 22 using System.Windows.Forms; 24 23 using HeuristicLab.MainForm; 25 using HeuristicLab.PluginInfrastructure;26 24 27 25 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 31 29 public ClusteringSolutionView() { 32 30 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);37 31 } 38 32 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
r6612 r6642 46 46 selectedName = itemsListView.SelectedItems[0].Text; 47 47 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 55 48 base.OnContentChanged(); 56 57 //readd viewTypes 58 foreach (var tuple in viewTypes) 59 AddViewListViewItem(tuple.Item1, tuple.Item2); 49 AddEvaluationViewTypes(); 60 50 61 51 //recover selection … … 65 55 item.Selected = true; 66 56 } 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); 67 66 } 68 67 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DiscriminantFunctionClassificationSolutionView.cs
r6612 r6642 20 20 #endregion 21 21 22 using System;23 22 using System.Windows.Forms; 24 23 using HeuristicLab.MainForm; 25 using HeuristicLab.PluginInfrastructure;26 24 27 25 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 31 29 public DiscriminantFunctionClassificationSolutionView() { 32 30 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);42 31 } 43 32 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
r6612 r6642 20 20 #endregion 21 21 22 using System;23 22 using System.Windows.Forms; 24 23 using HeuristicLab.MainForm; 25 using HeuristicLab.PluginInfrastructure;26 24 27 25 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 31 29 public RegressionSolutionView() { 32 30 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);37 31 } 38 32
Note: See TracChangeset
for help on using the changeset viewer.