Changeset 13823
- Timestamp:
- 05/03/16 09:47:26 (8 years ago)
- Location:
- branches/HeuristicLab.RegressionSolutionGradientView
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionEstimatedValuesView.cs
r13592 r13823 53 53 var testRows = Content.ProblemData.TestIndices; 54 54 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(); 57 57 58 58 foreach (var row in Content.ProblemData.TrainingIndices) { -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionInteractiveRangeEstimatorView.cs
r13816 r13823 114 114 var model = Content.Model; 115 115 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(); 117 117 118 118 // Charting config -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis.Views/3.4/GaussianProcessRegressionSolutionLineChartView.cs
r13121 r13823 69 69 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.Color = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Color; 70 70 var mean = Content.EstimatedTrainingValues.ToArray(); 71 var s2 = Content.EstimatedTrainingVariance .ToArray();71 var s2 = Content.EstimatedTrainingVariances.ToArray(); 72 72 var lower = mean.Zip(s2, GetLowerConfBound).ToArray(); 73 73 var upper = mean.Zip(s2, GetUpperConfBound).ToArray(); … … 82 82 83 83 mean = Content.EstimatedTestValues.ToArray(); 84 s2 = Content.EstimatedTestVariance .ToArray();84 s2 = Content.EstimatedTestVariances.ToArray(); 85 85 lower = mean.Zip(s2, GetLowerConfBound).ToArray(); 86 86 upper = mean.Zip(s2, GetUpperConfBound).ToArray(); … … 92 92 int[] allIndices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray(); 93 93 mean = Content.EstimatedValues.ToArray(); 94 s2 = Content.EstimatedVariance .ToArray();94 s2 = Content.EstimatedVariances.ToArray(); 95 95 lower = mean.Zip(s2, GetLowerConfBound).ToArray(); 96 96 upper = mean.Zip(s2, GetUpperConfBound).ToArray(); … … 264 264 indices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray(); 265 265 mean = Content.EstimatedValues.ToArray(); 266 s2 = Content.EstimatedVariance .ToArray();266 s2 = Content.EstimatedVariances.ToArray(); 267 267 lower = mean.Zip(s2, GetLowerConfBound).ToArray(); 268 268 upper = mean.Zip(s2, GetUpperConfBound).ToArray(); … … 273 273 indices = Content.ProblemData.TrainingIndices.ToArray(); 274 274 mean = Content.EstimatedTrainingValues.ToArray(); 275 s2 = Content.EstimatedTrainingVariance .ToArray();275 s2 = Content.EstimatedTrainingVariances.ToArray(); 276 276 lower = mean.Zip(s2, GetLowerConfBound).ToArray(); 277 277 upper = mean.Zip(s2, GetUpperConfBound).ToArray(); … … 280 280 indices = Content.ProblemData.TestIndices.ToArray(); 281 281 mean = Content.EstimatedTestValues.ToArray(); 282 s2 = Content.EstimatedTestVariance .ToArray();282 s2 = Content.EstimatedTestVariances.ToArray(); 283 283 lower = mean.Zip(s2, GetLowerConfBound).ToArray(); 284 284 upper = mean.Zip(s2, GetUpperConfBound).ToArray(); -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessModel.cs
r13784 r13823 346 346 } 347 347 348 public IEnumerable<double> GetEstimatedVariance (IDataset dataset, IEnumerable<int> rows) {348 public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) { 349 349 try { 350 350 if (x == null) { -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/GaussianProcessRegressionSolution.cs
r12012 r13823 33 33 [Item("GaussianProcessRegressionSolution", "Represents a Gaussian process solution for a regression problem which can be visualized in the GUI.")] 34 34 [StorableClass] 35 public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution {35 public sealed class GaussianProcessRegressionSolution : RegressionSolution, IGaussianProcessSolution, IConfidenceBoundRegressionSolution { 36 36 private new readonly Dictionary<int, double> evaluationCache; 37 37 … … 61 61 } 62 62 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)); } 65 65 } 66 public IEnumerable<double> EstimatedTrainingVariance {67 get { return GetEstimatedVariance (ProblemData.TrainingIndices); }66 public IEnumerable<double> EstimatedTrainingVariances { 67 get { return GetEstimatedVariances(ProblemData.TrainingIndices); } 68 68 } 69 public IEnumerable<double> EstimatedTestVariance {70 get { return GetEstimatedVariance (ProblemData.TestIndices); }69 public IEnumerable<double> EstimatedTestVariances { 70 get { return GetEstimatedVariances(ProblemData.TestIndices); } 71 71 } 72 72 73 public IEnumerable<double> GetEstimatedVariance (IEnumerable<int> rows) {73 public IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows) { 74 74 var rowsToEvaluate = rows.Except(evaluationCache.Keys); 75 75 var rowsEnumerator = rowsToEvaluate.GetEnumerator(); 76 var valuesEnumerator = Model.GetEstimatedVariance (ProblemData.Dataset, rowsToEvaluate).GetEnumerator();76 var valuesEnumerator = Model.GetEstimatedVariances(ProblemData.Dataset, rowsToEvaluate).GetEnumerator(); 77 77 78 78 while (rowsEnumerator.MoveNext() & valuesEnumerator.MoveNext()) { -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/StudentTProcessModel.cs
r13784 r13823 363 363 } 364 364 365 public IEnumerable<double> GetEstimatedVariance (IDataset dataset, IEnumerable<int> rows) {365 public IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows) { 366 366 try { 367 367 if (x == null) { -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Algorithms.DataAnalysis/3.4/Interfaces/IGaussianProcessModel.cs
r12509 r13823 20 20 #endregion 21 21 22 using System.Collections.Generic;23 22 using HeuristicLab.Problems.DataAnalysis; 24 23 … … 27 26 /// Interface to represent a Gaussian process posterior 28 27 /// </summary> 29 public interface IGaussianProcessModel : I RegressionModel {28 public interface IGaussianProcessModel : IConfidenceBoundRegressionModel { 30 29 double NegativeLogLikelihood { get; } 31 30 double SigmaNoise { get; } … … 34 33 double[] HyperparameterGradients { get; } 35 34 36 IEnumerable<double> GetEstimatedVariance(IDataset ds, IEnumerable<int> rows);37 35 void FixParameters(); 38 36 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionModel.cs
r12509 r13823 26 26 IRegressionSolution CreateRegressionSolution(IRegressionProblemData problemData); 27 27 } 28 29 public interface IConfidenceBoundRegressionModel : IRegressionModel { 30 IEnumerable<double> GetEstimatedVariances(IDataset dataset, IEnumerable<int> rows); 31 } 28 32 } -
branches/HeuristicLab.RegressionSolutionGradientView/HeuristicLab.Problems.DataAnalysis/3.4/Interfaces/Regression/IRegressionSolution.cs
r12851 r13823 44 44 double TestRootMeanSquaredError { get; } 45 45 } 46 47 public interface IConfidenceBoundRegressionSolution : IRegressionSolution { 48 IEnumerable<double> GetEstimatedVariances(IEnumerable<int> rows); 49 } 46 50 }
Note: See TracChangeset
for help on using the changeset viewer.