Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13824


Ignore:
Timestamp:
05/03/16 12:25:30 (9 years ago)
Author:
pfleck
Message:

#2597:

  • Added new Model property in IConfidenceBoundRegressionSolution.
  • Added ConfidenceBoundRegressionSolution base and methods to it from GaussianProcessRegressionSolution.
  • Replaced RegressionSolutionGradientView with GaussianProcessRegressionSolutionInteractiveRangeEstimatorView. Also moved DensityTrackbar to Problems.DataAnalysis.Views Plugin.
  • DensityTrackbar initial position is now where the density is highest.
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  
    195195      <DependentUpon>GaussianProcessRegressionSolutionEstimatedValuesView.cs</DependentUpon>
    196196    </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>
    203197    <Compile Include="MeanProdView.cs">
    204198      <SubType>UserControl</SubType>
     
    255249    <Compile Include="GaussianProcessRegressionSolutionLineChartView.Designer.cs">
    256250      <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>
    263251    </Compile>
    264252    <Compile Include="SupportVectorMachineModelSupportVectorsView.cs">
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs

    r13823 r13824  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    23 using System.Linq;
    2422using HeuristicLab.Common;
    2523using HeuristicLab.Core;
     
    3331  [Item("GaussianProcessRegressionSolution", "Represents a Gaussian process solution for a regression problem which can be visualized in the GUI.")]
    3432  [StorableClass]
    35   public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution, IConfidenceBoundRegressionSolution {
    36     private new readonly Dictionary<int, double> evaluationCache;
     33  public sealed class GaussianProcessRegressionSolution : ConfidenceBoundRegressionSolution, IGaussianProcessSolution {
    3734
    3835    public new IGaussianProcessModel Model {
     
    4441    private GaussianProcessRegressionSolution(bool deserializing)
    4542      : base(deserializing) {
    46       evaluationCache = new Dictionary<int, double>();
    47 
    4843    }
    4944    private GaussianProcessRegressionSolution(GaussianProcessRegressionSolution original, Cloner cloner)
    50       : base(original, cloner) {
    51       evaluationCache = new Dictionary<int, double>(original.evaluationCache);
    52     }
     45      : base(original, cloner) { }
    5346    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) { }
    5848
    5949    public override IDeepCloneable Clone(Cloner cloner) {
    6050      return new GaussianProcessRegressionSolution(this, cloner);
    6151    }
    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     }
    9352  }
    9453}
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs

    r12012 r13824  
    2626  /// Interface to represent a Gaussian process solution (either regression or classification)
    2727  /// </summary>
    28   public interface IGaussianProcessSolution : IDataAnalysisSolution {
     28  public interface IGaussianProcessSolution : IConfidenceBoundRegressionSolution {
    2929    new IGaussianProcessModel Model { get; }
    3030  }
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.Designer.cs

    r13819 r13824  
    5050      this.radioButton = new System.Windows.Forms.RadioButton();
    5151      this.trackBar = new System.Windows.Forms.TrackBar();
    52       this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView();
    5352      this.chart = new HeuristicLab.Visualization.ChartControlsExtensions.EnhancedChart();
    5453      this.textBox = new System.Windows.Forms.TextBox();
    5554      this.groupBox = new System.Windows.Forms.GroupBox();
     55      this.doubleLimitView = new HeuristicLab.Problems.DataAnalysis.Views.DoubleLimitView();
    5656      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).BeginInit();
    5757      ((System.ComponentModel.ISupportInitialize)(this.chart)).BeginInit();
     
    8080      this.trackBar.Name = "trackBar";
    8181      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);
    8383      this.trackBar.TabIndex = 1;
    8484      this.trackBar.TickFrequency = 100;
    8585      this.trackBar.Value = 500;
    8686      this.trackBar.ValueChanged += new System.EventHandler(this.trackBar_ValueChanged);
    87       //
    88       // doubleLimitView
    89       //
    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;
    9887      //
    9988      // chart
     
    116105      chartArea1.Position.Width = 100F;
    117106      this.chart.ChartAreas.Add(chartArea1);
    118       this.chart.Location = new System.Drawing.Point(157, 35);
     107      this.chart.Location = new System.Drawing.Point(156, 35);
    119108      this.chart.Name = "chart";
    120109      series1.ChartArea = "ChartArea1";
     
    122111      series1.Name = "Default";
    123112      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);
    125114      this.chart.TabIndex = 3;
    126115      this.chart.Text = "Density";
     
    144133      this.groupBox.Location = new System.Drawing.Point(0, 0);
    145134      this.groupBox.Name = "groupBox";
    146       this.groupBox.Size = new System.Drawing.Size(500, 62);
     135      this.groupBox.Size = new System.Drawing.Size(678, 62);
    147136      this.groupBox.TabIndex = 5;
    148137      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;
    149149      //
    150150      // DensityTrackbar
     
    153153      this.Controls.Add(this.groupBox);
    154154      this.Name = "DensityTrackbar";
    155       this.Size = new System.Drawing.Size(500, 62);
     155      this.Size = new System.Drawing.Size(678, 62);
    156156      ((System.ComponentModel.ISupportInitialize)(this.trackBar)).EndInit();
    157157      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/DensityTrackbar.cs

    r13819 r13824  
    2626using System.Windows.Forms;
    2727using System.Windows.Forms.DataVisualization.Charting;
     28using HeuristicLab.Common;
    2829using HeuristicLab.Problems.DataAnalysis;
    2930
     
    5051    private IList<double> trainingValues;
    5152
     53    // For VisualStudio Designer
    5254    internal DensityTrackbar() {
    5355      InitializeComponent();
     
    98100
    99101      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];
    100107    }
    101108
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r13819 r13824  
    103103      <Private>False</Private>
    104104    </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>
    109105    <Reference Include="HeuristicLab.Analysis-3.3">
    110106      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
     
    250246      <DependentUpon>ClusteringSolutionVisualizationView.cs</DependentUpon>
    251247    </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>
    252254    <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationView.cs">
    253255      <SubType>UserControl</SubType>
     
    268270    <Compile Include="FeatureCorrelation\FeatureCorrelationView.Designer.cs">
    269271      <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>
    270278    </Compile>
    271279    <Compile Include="Interfaces\IDataPreprocessorStarter.cs" />
     
    283291    <Compile Include="ProblemDataView.Designer.cs">
    284292      <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>
    291293    </Compile>
    292294    <Compile Include="RegressionSolutionTargetResponseGradientView.cs">
     
    500502  </ItemGroup>
    501503  <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>
    502508    <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis\3.4\HeuristicLab.Problems.DataAnalysis-3.4.csproj">
    503509      <Project>{df87c13e-a889-46ff-8153-66dcaa8c5674}</Project>
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.Designer.cs

    r13819 r13824  
    2121
    2222namespace HeuristicLab.Algorithms.DataAnalysis.Views {
    23   partial class GaussianProcessRegressionSolutionInteractiveRangeEstimatorView {
     23  partial class RegressionSolutionGradientView {
    2424    /// <summary>
    2525    /// Required designer variable.
     
    125125      this.tableLayoutPanel.TabIndex = 0;
    126126      //
    127       // GaussianProcessRegressionSolutionInteractiveRangeEstimatorView
     127      // RegressionSolutionGradientView
    128128      //
    129129      this.AllowDrop = true;
    130130      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
    131131      this.Controls.Add(this.splitContainer);
    132       this.Name = "GaussianProcessRegressionSolutionInteractiveRangeEstimatorView";
     132      this.Name = "RegressionSolutionGradientView";
    133133      this.Size = new System.Drawing.Size(715, 591);
    134134      ((System.ComponentModel.ISupportInitialize)(this.chart)).EndInit();
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis.Views/3.4/RegressionSolutionGradientView.cs

    r13823 r13824  
    3535
    3636namespace HeuristicLab.Algorithms.DataAnalysis.Views {
    37   [View("Interactive Estimator")]
    38   [Content(typeof(GaussianProcessRegressionSolution))]
    39   public partial class GaussianProcessRegressionSolutionInteractiveRangeEstimatorView
     37  [View("Gradient View")]
     38  [Content(typeof(IConfidenceBoundRegressionSolution))]
     39  public partial class RegressionSolutionGradientView
    4040    : DataAnalysisSolutionEvaluationView {
    4141
     
    5252    }
    5353
    54     public new GaussianProcessRegressionSolution Content {
    55       get { return (GaussianProcessRegressionSolution)base.Content; }
     54    public new IConfidenceBoundRegressionSolution Content {
     55      get { return (IConfidenceBoundRegressionSolution)base.Content; }
    5656      set { base.Content = value; }
    5757    }
    5858
    59     public GaussianProcessRegressionSolutionInteractiveRangeEstimatorView()
     59    public RegressionSolutionGradientView()
    6060      : base() {
    6161      dimensionNames = new List<string>();
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r13819 r13824  
    176176    <Compile Include="Implementation\Clustering\ClusteringSolution.cs" />
    177177    <Compile Include="Implementation\ConstantModel.cs" />
     178    <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" />
    178179    <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
    179180    <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" />
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs

    r13823 r13824  
    4646
    4747  public interface IConfidenceBoundRegressionSolution : IRegressionSolution {
     48    new IConfidenceBoundRegressionModel Model { get; }
     49
    4850    IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows);
    4951  }
Note: See TracChangeset for help on using the changeset viewer.