- Timestamp:
- 06/25/12 10:16:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r7701 r8100 26 26 using System.Windows.Forms.DataVisualization.Charting; 27 27 using HeuristicLab.MainForm; 28 using HeuristicLab.MainForm.WindowsForms;29 28 30 29 namespace HeuristicLab.Problems.DataAnalysis.Views { … … 32 31 [Content(typeof(IRegressionSolution))] 33 32 public partial class RegressionSolutionErrorCharacteristicsCurveView : DataAnalysisSolutionEvaluationView { 34 private IRegressionSolution constantModel;35 33 protected const string TrainingSamples = "Training"; 36 34 protected const string TestSamples = "Test"; … … 103 101 if (Content == null) return; 104 102 103 var constantModel = CreateConstantModel(); 105 104 var originalValues = GetOriginalValues().ToList(); 106 constantModel = CreateConstantModel();107 105 var baselineEstimatedValues = GetEstimatedValues(constantModel); 108 106 var baselineResiduals = GetResiduals(originalValues, baselineEstimatedValues); … … 201 199 } 202 200 203 protected IEnumerable<double> GetbaselineEstimatedValues(IEnumerable<double> originalValues) {204 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndizes).Average();205 return Enumerable.Repeat(averageTrainingTarget, originalValues.Count());206 }207 208 201 protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) { 209 202 return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList();
Note: See TracChangeset
for help on using the changeset viewer.