Free cookie consent management tool by TermsFeed Policy Generator

Changeset 13823


Ignore:
Timestamp:
05/03/16 09:47:26 (8 years ago)
Author:
pfleck
Message:

#2597:

  • Added new interface IConfidenceBoundRegressionModel and IConfidenceBoundRegressionSolution for regression models/solutions that support confidence information on estimated samples.
  • Renamed GetEstimatedVariance to GetEstimatedVariances to be consistent with GetEstimatedValues.
Location:
branches/HeuristicLab.RegressionSolutionGradientView
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionEstimatedValuesView.cs

    r13592 r13823  
    5353      var testRows = Content.ProblemData.TestIndices;
    5454
    55       var estimated_var_training = Content.GetEstimatedVariance(trainingRows).GetEnumerator();
    56       var estimated_var_test = Content.GetEstimatedVariance(testRows).GetEnumerator();
     55      var estimated_var_training = Content.GetEstimatedVariances(trainingRows).GetEnumerator();
     56      var estimated_var_test = Content.GetEstimatedVariances(testRows).GetEnumerator();
    5757
    5858      foreach (var row in Content.ProblemData.TrainingIndices) {
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs

    r13816 r13823  
    114114      var model = Content.Model;
    115115      var means = model.GetEstimatedValues(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
    116       var variances = model.GetEstimatedVariance(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
     116      var variances = model.GetEstimatedVariances(dataset, Enumerable.Range(0, DrawingSteps)).ToList();
    117117
    118118      // Charting config
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionLineChartView.cs

    r13121 r13823  
    6969        this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.Color = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Color;
    7070        var mean = Content.EstimatedTrainingValues.ToArray();
    71         var s2 = Content.EstimatedTrainingVariance.ToArray();
     71        var s2 = Content.EstimatedTrainingVariances.ToArray();
    7272        var lower = mean.Zip(s2, GetLowerConfBound).ToArray();
    7373        var upper = mean.Zip(s2, GetUpperConfBound).ToArray();
     
    8282
    8383        mean = Content.EstimatedTestValues.ToArray();
    84         s2 = Content.EstimatedTestVariance.ToArray();
     84        s2 = Content.EstimatedTestVariances.ToArray();
    8585        lower = mean.Zip(s2, GetLowerConfBound).ToArray();
    8686        upper = mean.Zip(s2, GetUpperConfBound).ToArray();
     
    9292        int[] allIndices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray();
    9393        mean = Content.EstimatedValues.ToArray();
    94         s2 = Content.EstimatedVariance.ToArray();
     94        s2 = Content.EstimatedVariances.ToArray();
    9595        lower = mean.Zip(s2, GetLowerConfBound).ToArray();
    9696        upper = mean.Zip(s2, GetUpperConfBound).ToArray();
     
    264264            indices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray();
    265265            mean = Content.EstimatedValues.ToArray();
    266             s2 = Content.EstimatedVariance.ToArray();
     266            s2 = Content.EstimatedVariances.ToArray();
    267267            lower = mean.Zip(s2, GetLowerConfBound).ToArray();
    268268            upper = mean.Zip(s2, GetUpperConfBound).ToArray();
     
    273273            indices = Content.ProblemData.TrainingIndices.ToArray();
    274274            mean = Content.EstimatedTrainingValues.ToArray();
    275             s2 = Content.EstimatedTrainingVariance.ToArray();
     275            s2 = Content.EstimatedTrainingVariances.ToArray();
    276276            lower = mean.Zip(s2, GetLowerConfBound).ToArray();
    277277            upper = mean.Zip(s2, GetUpperConfBound).ToArray();
     
    280280            indices = Content.ProblemData.TestIndices.ToArray();
    281281            mean = Content.EstimatedTestValues.ToArray();
    282             s2 = Content.EstimatedTestVariance.ToArray();
     282            s2 = Content.EstimatedTestVariances.ToArray();
    283283            lower = mean.Zip(s2, GetLowerConfBound).ToArray();
    284284            upper = mean.Zip(s2, GetUpperConfBound).ToArray();
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs

    r13784 r13823  
    346346    }
    347347
    348     public IEnumerable<double> GetEstimatedVariance(IDataset dataset, IEnumerable<int> rows) {
     348    public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) {
    349349      try {
    350350        if (x == null) {
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs

    r12012 r13823  
    3333  [Item("GaussianProcessRegressionSolution", "Represents a Gaussian process solution for a regression problem which can be visualized in the GUI.")]
    3434  [StorableClass]
    35   public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution {
     35  public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution, IConfidenceBoundRegressionSolution {
    3636    private new readonly Dictionary<int, double> evaluationCache;
    3737
     
    6161    }
    6262
    63     public IEnumerable<double> EstimatedVariance {
    64       get { return GetEstimatedVariance(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
     63    public IEnumerable<double> EstimatedVariances {
     64      get { return GetEstimatedVariances(Enumerable.Range(0, ProblemData.Dataset.Rows)); }
    6565    }
    66     public IEnumerable<double> EstimatedTrainingVariance {
    67       get { return GetEstimatedVariance(ProblemData.TrainingIndices); }
     66    public IEnumerable<double> EstimatedTrainingVariances {
     67      get { return GetEstimatedVariances(ProblemData.TrainingIndices); }
    6868    }
    69     public IEnumerable<double> EstimatedTestVariance {
    70       get { return GetEstimatedVariance(ProblemData.TestIndices); }
     69    public IEnumerable<double> EstimatedTestVariances {
     70      get { return GetEstimatedVariances(ProblemData.TestIndices); }
    7171    }
    7272
    73     public IEnumerable<double> GetEstimatedVariance(IEnumerable<int> rows) {
     73    public IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows) {
    7474      var rowsToEvaluate = rows.Except(evaluationCache.Keys);
    7575      var rowsEnumerator = rowsToEvaluate.GetEnumerator();
    76       var valuesEnumerator = Model.GetEstimatedVariance(ProblemData.Dataset, rowsToEvaluate).GetEnumerator();
     76      var valuesEnumerator = Model.GetEstimatedVariances(ProblemData.Dataset, rowsToEvaluate).GetEnumerator();
    7777
    7878      while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) {
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/StudentTProcessModel.cs

    r13784 r13823  
    363363    }
    364364
    365     public IEnumerable<double> GetEstimatedVariance(IDataset dataset, IEnumerable<int> rows) {
     365    public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) {
    366366      try {
    367367        if (x == null) {
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs

    r12509 r13823  
    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  }
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs

    r12509 r13823  
    2626    IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData);
    2727  }
     28
     29  public interface IConfidenceBoundRegressionModel : IRegressionModel {
     30    IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows);
     31  }
    2832}
  • branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs

    r12851 r13823  
    4444    double TestRootMeanSquaredError { get; }
    4545  }
     46
     47  public interface IConfidenceBoundRegressionSolution : IRegressionSolution {
     48    IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows);
     49  }
    4650}
Note: See TracChangeset for help on using the changeset viewer.