Changeset 13824
- Timestamp:
- 05/03/16 12:25:30 (9 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView
- Files:
-
- 1 added
- 6 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj
r13816 r13824 195 195 <DependentUpon>GaussianProcessRegressionSolutionEstimatedValuesView.cs</DependentUpon> 196 196 </Compile> 197 <Compile Include="DensityTrackbar.cs">198 <SubType>UserControl</SubType>199 </Compile>200 <Compile Include="DensityTrackbar.Designer.cs">201 <DependentUpon>DensityTrackbar.cs</DependentUpon>202 </Compile>203 197 <Compile Include="MeanProdView.cs"> 204 198 <SubType>UserControl</SubType> … … 255 249 <Compile Include="GaussianProcessRegressionSolutionLineChartView.Designer.cs"> 256 250 <DependentUpon>GaussianProcessRegressionSolutionLineChartView.cs</DependentUpon> 257 </Compile>258 <Compile Include="GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs">259 <SubType>UserControl</SubType>260 </Compile>261 <Compile Include="GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.Designer.cs">262 <DependentUpon>GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs</DependentUpon>263 251 </Compile> 264 252 <Compile Include="SupportVectorMachineModelSupportVectorsView.cs"> -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs
r13823 r13824 20 20 #endregion 21 21 22 using System.Collections.Generic;23 using System.Linq;24 22 using HeuristicLab.Common; 25 23 using HeuristicLab.Core; … … 33 31 [Item("GaussianProcessRegressionSolution", "Represents a Gaussian process solution for a regression problem which can be visualized in the GUI.")] 34 32 [StorableClass] 35 public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution, IConfidenceBoundRegressionSolution { 36 private new readonly Dictionary<int, double> evaluationCache; 33 public sealed class GaussianProcessRegressionSolution : ConfidenceBoundRegressionSolution, IGaussianProcessSolution { 37 34 38 35 public new IGaussianProcessModel Model { … … 44 41 private GaussianProcessRegressionSolution(bool deserializing) 45 42 : base(deserializing) { 46 evaluationCache = new Dictionary<int, double>();47 48 43 } 49 44 private GaussianProcessRegressionSolution(GaussianProcessRegressionSolution original, Cloner cloner) 50 : base(original, cloner) { 51 evaluationCache = new Dictionary<int, double>(original.evaluationCache); 52 } 45 : base(original, cloner) { } 53 46 public GaussianProcessRegressionSolution(IGaussianProcessModel model, IRegressionProblemData problemData) 54 : base(model, problemData) { 55 56 evaluationCache = new Dictionary<int, double>(problemData.Dataset.Rows); 57 } 47 : base(model, problemData) { } 58 48 59 49 public override IDeepCloneable Clone(Cloner cloner) { 60 50 return new GaussianProcessRegressionSolution(this, cloner); 61 51 } 62 63 public IEnumerable<double> EstimatedVariances {64 get { return GetEstimatedVariances(Enumerable.Range(0, ProblemData.Dataset.Rows)); }65 }66 public IEnumerable<double> EstimatedTrainingVariances {67 get { return GetEstimatedVariances(ProblemData.TrainingIndices); }68 }69 public IEnumerable<double> EstimatedTestVariances {70 get { return GetEstimatedVariances(ProblemData.TestIndices); }71 }72 73 public IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows) {74 var rowsToEvaluate = rows.Except(evaluationCache.Keys);75 var rowsEnumerator = rowsToEvaluate.GetEnumerator();76 var valuesEnumerator = Model.GetEstimatedVariances(ProblemData.Dataset, rowsToEvaluate).GetEnumerator();77 78 while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) {79 evaluationCache.Add(rowsEnumerator.Current, valuesEnumerator.Current);80 }81 82 return rows.Select(row => evaluationCache[row]);83 }84 85 protected override void OnModelChanged() {86 evaluationCache.Clear();87 base.OnModelChanged();88 }89 protected override void OnProblemDataChanged() {90 evaluationCache.Clear();91 base.OnProblemDataChanged();92 }93 52 } 94 53 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs
r12012 r13824 26 26 /// Interface to represent a Gaussian process solution (either regression or classification) 27 27 /// </summary> 28 public interface IGaussianProcessSolution : I DataAnalysisSolution {28 public interface IGaussianProcessSolution : IConfidenceBoundRegressionSolution { 29 29 new IGaussianProcessModel Model { get; } 30 30 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs
r13819 r13824 50 50 this.radioButton = new System.Windows.Forms.RadioButton(); 51 51 this.trackBar = new System.Windows.Forms.TrackBar(); 52 this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView();53 52 this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart(); 54 53 this.textBox = new System.Windows.Forms.TextBox(); 55 54 this.groupBox = new System.Windows.Forms.GroupBox(); 55 this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView(); 56 56 ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit(); 57 57 ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit(); … … 80 80 this.trackBar.Name = "trackBar"; 81 81 this.trackBar.RightToLeft = System.Windows.Forms.RightToLeft.No; 82 this.trackBar.Size = new System.Drawing.Size( 193, 45);82 this.trackBar.Size = new System.Drawing.Size(371, 45); 83 83 this.trackBar.TabIndex = 1; 84 84 this.trackBar.TickFrequency = 100; 85 85 this.trackBar.Value = 500; 86 86 this.trackBar.ValueChanged += new System.EventHandler(this.trackBar_ValueChanged); 87 //88 // doubleLimitView89 //90 this.doubleLimitView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));91 this.doubleLimitView.Caption = "DoubleLimit View";92 this.doubleLimitView.Content = null;93 this.doubleLimitView.Location = new System.Drawing.Point(343, 10);94 this.doubleLimitView.Name = "doubleLimitView";95 this.doubleLimitView.ReadOnly = false;96 this.doubleLimitView.Size = new System.Drawing.Size(151, 47);97 this.doubleLimitView.TabIndex = 2;98 87 // 99 88 // chart … … 116 105 chartArea1.Position.Width = 100F; 117 106 this.chart.ChartAreas.Add(chartArea1); 118 this.chart.Location = new System.Drawing.Point(15 7, 35);107 this.chart.Location = new System.Drawing.Point(156, 35); 119 108 this.chart.Name = "chart"; 120 109 series1.ChartArea = "ChartArea1"; … … 122 111 series1.Name = "Default"; 123 112 this.chart.Series.Add(series1); 124 this.chart.Size = new System.Drawing.Size( 168, 20);113 this.chart.Size = new System.Drawing.Size(345, 20); 125 114 this.chart.TabIndex = 3; 126 115 this.chart.Text = "Density"; … … 144 133 this.groupBox.Location = new System.Drawing.Point(0, 0); 145 134 this.groupBox.Name = "groupBox"; 146 this.groupBox.Size = new System.Drawing.Size( 500, 62);135 this.groupBox.Size = new System.Drawing.Size(678, 62); 147 136 this.groupBox.TabIndex = 5; 148 137 this.groupBox.TabStop = false; 138 // 139 // doubleLimitView 140 // 141 this.doubleLimitView.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); 142 this.doubleLimitView.Caption = "DoubleLimit View"; 143 this.doubleLimitView.Content = null; 144 this.doubleLimitView.Location = new System.Drawing.Point(521, 10); 145 this.doubleLimitView.Name = "doubleLimitView"; 146 this.doubleLimitView.ReadOnly = false; 147 this.doubleLimitView.Size = new System.Drawing.Size(151, 47); 148 this.doubleLimitView.TabIndex = 2; 149 149 // 150 150 // DensityTrackbar … … 153 153 this.Controls.Add(this.groupBox); 154 154 this.Name = "DensityTrackbar"; 155 this.Size = new System.Drawing.Size( 500, 62);155 this.Size = new System.Drawing.Size(678, 62); 156 156 ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit(); 157 157 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs
r13819 r13824 26 26 using System.Windows.Forms; 27 27 using System.Windows.Forms.DataVisualization.Charting; 28 using HeuristicLab.Common; 28 29 using HeuristicLab.Problems.DataAnalysis; 29 30 … … 50 51 private IList<double> trainingValues; 51 52 53 // For VisualStudio Designer 52 54 internal DensityTrackbar() { 53 55 InitializeComponent(); … … 98 100 99 101 series.Points.DataBindY(buckets); 102 103 // Set trackbar on highest density 104 double highestDensity = buckets.Max(); 105 var highestIndices = buckets.Select((v, i) => new { v, i }).Where(x => x.v.IsAlmost(highestDensity)).Select(x => x.i).ToList(); 106 trackBar.Value = highestIndices[highestIndices.Count / 2]; 100 107 } 101 108 -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj
r13819 r13824 103 103 <Private>False</Private> 104 104 </Reference> 105 <Reference Include="HeuristicLab.Algorithms.DataAnalysis-3.4">106 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>107 <Private>False</Private>108 </Reference>109 105 <Reference Include="HeuristicLab.Analysis-3.3"> 110 106 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath> … … 250 246 <DependentUpon>ClusteringSolutionVisualizationView.cs</DependentUpon> 251 247 </Compile> 248 <Compile Include="DensityTrackbar.cs"> 249 <SubType>UserControl</SubType> 250 </Compile> 251 <Compile Include="DensityTrackbar.Designer.cs"> 252 <DependentUpon>DensityTrackbar.cs</DependentUpon> 253 </Compile> 252 254 <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationView.cs"> 253 255 <SubType>UserControl</SubType> … … 268 270 <Compile Include="FeatureCorrelation\FeatureCorrelationView.Designer.cs"> 269 271 <DependentUpon>FeatureCorrelationView.cs</DependentUpon> 272 </Compile> 273 <Compile Include="RegressionSolutionGradientView.cs"> 274 <SubType>UserControl</SubType> 275 </Compile> 276 <Compile Include="RegressionSolutionGradientView.Designer.cs"> 277 <DependentUpon>RegressionSolutionGradientView.cs</DependentUpon> 270 278 </Compile> 271 279 <Compile Include="Interfaces\IDataPreprocessorStarter.cs" /> … … 283 291 <Compile Include="ProblemDataView.Designer.cs"> 284 292 <DependentUpon>ProblemDataView.cs</DependentUpon> 285 </Compile>286 <Compile Include="RegressionSolutionGradientView.cs">287 <SubType>UserControl</SubType>288 </Compile>289 <Compile Include="RegressionSolutionGradientView.Designer.cs">290 <DependentUpon>RegressionSolutionGradientView.cs</DependentUpon>291 293 </Compile> 292 294 <Compile Include="RegressionSolutionTargetResponseGradientView.cs"> … … 500 502 </ItemGroup> 501 503 <ItemGroup> 504 <ProjectReference Include="..\..\HeuristicLab.Algorithms.DataAnalysis\3.4\HeuristicLab.Algorithms.DataAnalysis-3.4.csproj"> 505 <Project>{2E782078-FA81-4B70-B56F-74CE38DAC6C8}</Project> 506 <Name>HeuristicLab.Algorithms.DataAnalysis-3.4</Name> 507 </ProjectReference> 502 508 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj"> 503 509 <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project> -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.Designer.cs
r13819 r13824 21 21 22 22 namespace HeuristicLab.Algorithms.DataAnalysis.Views { 23 partial class GaussianProcessRegressionSolutionInteractiveRangeEstimatorView {23 partial class RegressionSolutionGradientView { 24 24 /// <summary> 25 25 /// Required designer variable. … … 125 125 this.tableLayoutPanel.TabIndex = 0; 126 126 // 127 // GaussianProcessRegressionSolutionInteractiveRangeEstimatorView127 // RegressionSolutionGradientView 128 128 // 129 129 this.AllowDrop = true; 130 130 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 131 131 this.Controls.Add(this.splitContainer); 132 this.Name = " GaussianProcessRegressionSolutionInteractiveRangeEstimatorView";132 this.Name = "RegressionSolutionGradientView"; 133 133 this.Size = new System.Drawing.Size(715, 591); 134 134 ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit(); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs
r13823 r13824 35 35 36 36 namespace HeuristicLab.Algorithms.DataAnalysis.Views { 37 [View(" Interactive Estimator")]38 [Content(typeof( GaussianProcessRegressionSolution))]39 public partial class GaussianProcessRegressionSolutionInteractiveRangeEstimatorView37 [View("Gradient View")] 38 [Content(typeof(IConfidenceBoundRegressionSolution))] 39 public partial class RegressionSolutionGradientView 40 40 : DataAnalysisSolutionEvaluationView { 41 41 … … 52 52 } 53 53 54 public new GaussianProcessRegressionSolution Content {55 get { return ( GaussianProcessRegressionSolution)base.Content; }54 public new IConfidenceBoundRegressionSolution Content { 55 get { return (IConfidenceBoundRegressionSolution)base.Content; } 56 56 set { base.Content = value; } 57 57 } 58 58 59 public GaussianProcessRegressionSolutionInteractiveRangeEstimatorView()59 public RegressionSolutionGradientView() 60 60 : base() { 61 61 dimensionNames = new List<string>(); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj
r13819 r13824 176 176 <Compile Include="Implementation\Clustering\ClusteringSolution.cs" /> 177 177 <Compile Include="Implementation\ConstantModel.cs" /> 178 <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" /> 178 179 <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" /> 179 180 <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" /> -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs
r13823 r13824 46 46 47 47 public interface IConfidenceBoundRegressionSolution : IRegressionSolution { 48 new IConfidenceBoundRegressionModel Model { get; } 49 48 50 IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows); 49 51 }
Note: See TracChangeset
for help on using the changeset viewer.