Free cookie consent management tool by TermsFeed Policy Generator

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/HeuristicLab.Algorithms.DataAnalysis/3.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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  }
Note: See TracChangeset for help on using the changeset viewer.