Changeset 14095


Ignore:
Timestamp:
07/18/16 15:23:22 (8 months ago)
Author:
mkommend
Message:

#2597: Merged all changesets from HeuristiLab.RegressionSolutionGradientView into the trunk.

Location:
trunk/sources
Files:
4 deleted
15 edited
18 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis

  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views

  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/HeuristicLab.Algorithms.DataAnalysis.Views-3.4.csproj

    r13439 r14095  
    125125  </ItemGroup>
    126126  <ItemGroup>
    127     <Compile Include="GaussianProcessRegressionSolutionEstimatedValuesView.cs">
    128       <SubType>UserControl</SubType>
    129     </Compile>
    130     <Compile Include="GaussianProcessRegressionSolutionEstimatedValuesView.Designer.cs">
    131       <DependentUpon>GaussianProcessRegressionSolutionEstimatedValuesView.cs</DependentUpon>
    132     </Compile>
    133127    <Compile Include="MeanProdView.cs">
    134128      <SubType>UserControl</SubType>
     
    180174    </Compile>
    181175    <Compile Include="Plugin.cs" />
    182     <Compile Include="GaussianProcessRegressionSolutionLineChartView.cs">
    183       <SubType>UserControl</SubType>
    184     </Compile>
    185     <Compile Include="GaussianProcessRegressionSolutionLineChartView.Designer.cs">
    186       <DependentUpon>GaussianProcessRegressionSolutionLineChartView.cs</DependentUpon>
    187     </Compile>
    188176    <Compile Include="SupportVectorMachineModelSupportVectorsView.cs">
    189177      <SubType>UserControl</SubType>
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs

    r13941 r14095  
    341341    }
    342342
    343     public IEnumerable<double> GetEstimatedVariance(IDataset dataset, IEnumerable<int> rows) {
     343    public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) {
    344344      try {
    345345        if (x == null) {
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs

    r12012 r14095  
    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 {
    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> EstimatedVariance {
    64       get { return GetEstimatedVariance(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
    65     }
    66     public IEnumerable<double> EstimatedTrainingVariance {
    67       get { return GetEstimatedVariance(ProblemData.TrainingIndices); }
    68     }
    69     public IEnumerable<double> EstimatedTestVariance {
    70       get { return GetEstimatedVariance(ProblemData.TestIndices); }
    71     }
    72 
    73     public IEnumerable<double> GetEstimatedVariance(IEnumerable<int> rows) {
    74       var rowsToEvaluate = rows.Except(evaluationCache.Keys);
    75       var rowsEnumerator = rowsToEvaluate.GetEnumerator();
    76       var valuesEnumerator = Model.GetEstimatedVariance(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}
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GradientBoostedTrees/RegressionTreeBuilder.cs

    r13993 r14095  
    2222
    2323using System;
    24 using System.Collections;
    2524using System.Collections.Generic;
    2625using System.Diagnostics;
     
    129128
    130129      // y and curPred are changed in gradient boosting
    131       this.y = y; 
    132       this.curPred = curPred; 
     130      this.y = y;
     131      this.curPred = curPred;
    133132
    134133      // shuffle row idx
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs

    r12509 r14095  
    2020#endregion
    2121
    22 using System.Collections.Generic;
    2322using HeuristicLab.Problems.DataAnalysis;
    2423
     
    2726  /// Interface to represent a Gaussian process posterior
    2827  /// </summary>
    29   public interface IGaussianProcessModel : IRegressionModel {
     28  public interface IGaussianProcessModel : IConfidenceBoundRegressionModel {
    3029    double NegativeLogLikelihood { get; }
    3130    double SigmaNoise { get; }
     
    3433    double[] HyperparameterGradients { get; }
    3534
    36     IEnumerable<double> GetEstimatedVariance(IDataset ds, IEnumerable<int> rows);
    3735    void FixParameters();
    3836  }
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessSolution.cs

    r12012 r14095  
    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  }
  • trunk/sources/HeuristicLab.Problems.DataAnalysis

  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views

  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Views-3.4.csproj

    r13938 r14095  
    120120  </ItemGroup>
    121121  <ItemGroup>
     122    <Compile Include="DensityChart.cs">
     123      <SubType>UserControl</SubType>
     124    </Compile>
     125    <Compile Include="DensityChart.Designer.cs">
     126      <DependentUpon>DensityChart.cs</DependentUpon>
     127    </Compile>
     128    <Compile Include="DensityTrackbar.cs">
     129      <SubType>UserControl</SubType>
     130    </Compile>
     131    <Compile Include="DensityTrackbar.Designer.cs">
     132      <DependentUpon>DensityTrackbar.cs</DependentUpon>
     133    </Compile>
    122134    <Compile Include="FeatureCorrelation\TimeframeFeatureCorrelationCalculator.cs" />
    123135    <Compile Include="FeatureCorrelation\AbstractFeatureCorrelationCalculator.cs" />
     
    183195      <DependentUpon>FeatureCorrelationView.cs</DependentUpon>
    184196    </Compile>
     197    <Compile Include="GradientChart.cs">
     198      <SubType>UserControl</SubType>
     199    </Compile>
     200    <Compile Include="GradientChart.Designer.cs">
     201      <DependentUpon>GradientChart.cs</DependentUpon>
     202    </Compile>
     203    <Compile Include="GradientChartConfigurationDialog.cs">
     204      <SubType>Form</SubType>
     205    </Compile>
     206    <Compile Include="GradientChartConfigurationDialog.Designer.cs">
     207      <DependentUpon>GradientChartConfigurationDialog.cs</DependentUpon>
     208    </Compile>
    185209    <Compile Include="Interfaces\IDataPreprocessorStarter.cs" />
    186210    <Compile Include="MenuItems\ShrinkDataAnalysisRunsMenuItem.cs" />
     
    198222      <DependentUpon>ProblemDataView.cs</DependentUpon>
    199223    </Compile>
     224    <Compile Include="Regression\ConfidenceBoundRegressionSolutionEstimatedValuesView.cs">
     225      <SubType>UserControl</SubType>
     226    </Compile>
     227    <Compile Include="Regression\ConfidenceBoundRegressionSolutionEstimatedValuesView.Designer.cs">
     228      <DependentUpon>ConfidenceBoundRegressionSolutionEstimatedValuesView.cs</DependentUpon>
     229    </Compile>
     230    <Compile Include="Regression\ConfidenceBoundRegressionSolutionLineChartView.cs">
     231      <SubType>UserControl</SubType>
     232    </Compile>
     233    <Compile Include="Regression\ConfidenceBoundRegressionSolutionLineChartView.Designer.cs">
     234      <DependentUpon>ConfidenceBoundRegressionSolutionLineChartView.cs</DependentUpon>
     235    </Compile>
    200236    <Compile Include="Regression\RegressionEnsembleSolutionModelWeightsView.cs">
    201237      <SubType>UserControl</SubType>
     
    209245    <Compile Include="Regression\RegressionFeatureCorrelationView.Designer.cs">
    210246      <DependentUpon>RegressionFeatureCorrelationView.cs</DependentUpon>
     247    </Compile>
     248    <Compile Include="Regression\RegressionSolutionGradientView.cs">
     249      <SubType>UserControl</SubType>
     250    </Compile>
     251    <Compile Include="Regression\RegressionSolutionGradientView.Designer.cs">
     252      <DependentUpon>RegressionSolutionGradientView.cs</DependentUpon>
     253    </Compile>
     254    <Compile Include="Regression\RegressionSolutionTargetResponseGradientView.cs">
     255      <SubType>UserControl</SubType>
     256    </Compile>
     257    <Compile Include="Regression\RegressionSolutionTargetResponseGradientView.Designer.cs">
     258      <DependentUpon>RegressionSolutionTargetResponseGradientView.cs</DependentUpon>
    211259    </Compile>
    212260    <Compile Include="Regression\RegressionTimeframeFeatureCorrelationView.cs">
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs

    r13942 r14095  
    3131
    3232namespace HeuristicLab.Problems.DataAnalysis.Views {
    33   [View("RegressionSolution View")]
     33  [View("Solution View")]
    3434  [Content(typeof(RegressionSolutionBase), false)]
    3535  public partial class RegressionSolutionView : DataAnalysisSolutionView {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/HeuristicLab.Problems.DataAnalysis-3.4.csproj

    r13986 r14095  
    138138    <Compile Include="Implementation\ConstantModel.cs" />
    139139    <Compile Include="Implementation\DataAnalysisModel.cs" />
     140    <Compile Include="Implementation\Regression\ConfidenceBoundRegressionSolution.cs" />
    140141    <Compile Include="Implementation\Regression\ConstantRegressionModel.cs" />
    141142    <Compile Include="Implementation\Regression\ConstantRegressionSolution.cs" />
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs

    r13921 r14095  
    2727    string TargetVariable { get; }
    2828  }
     29
     30  public interface IConfidenceBoundRegressionModel : IRegressionModel {
     31    IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows);
     32  }
    2933}
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs

    r12851 r14095  
    4444    double TestRootMeanSquaredError { get; }
    4545  }
     46
     47  public interface IConfidenceBoundRegressionSolution : IRegressionSolution {
     48    new IConfidenceBoundRegressionModel Model { get; }
     49
     50    IEnumerable<double> EstimatedVariances { get; }
     51    IEnumerable<double> EstimatedTrainingVariances { get; }
     52    IEnumerable<double> EstimatedTestVariances { get; }
     53    IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows);
     54  }
    4655}
Note: See TracChangeset for help on using the changeset viewer.