- Timestamp:
- 02/23/18 17:03:57 (7 years ago)
- Location:
- stable
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 15785,15787,15789-15790,15793,15810
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views (added) merged: 15810
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionErrorCharacteristicsCurveView.cs
r15584 r15811 23 23 using System.Collections; 24 24 using System.Collections.Generic; 25 using System.Diagnostics.Contracts;26 25 using System.Linq; 27 26 using HeuristicLab.Algorithms.DataAnalysis; -
stable/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.Problems.DataAnalysis.Views (added) merged: 15785,15787,15789-15790,15793,15810
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r15584 r15811 249 249 protected virtual List<double> GetResiduals(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues) { 250 250 switch (residualComboBox.SelectedItem.ToString()) { 251 case "Absolute error": return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)).ToList(); 252 case "Squared error": return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y)).ToList(); 253 case "Relative error": return originalValues.Zip(estimatedValues, (x, y) => x.IsAlmost(0.0) ? -1 : Math.Abs((x - y) / x)) 254 .Where(x => x > 0) // remove entries where the original value is 0 255 .ToList(); 251 case "Absolute error": return originalValues.Zip(estimatedValues, (x, y) => Math.Abs(x - y)) 252 .Where(r => !double.IsNaN(r) && !double.IsInfinity(r)).ToList(); 253 case "Squared error": return originalValues.Zip(estimatedValues, (x, y) => (x - y) * (x - y)) 254 .Where(r => !double.IsNaN(r) && !double.IsInfinity(r)).ToList(); 255 case "Relative error": 256 return originalValues.Zip(estimatedValues, (x, y) => x.IsAlmost(0.0) ? -1 : Math.Abs((x - y) / x)) 257 .Where(r => r > 0 && !double.IsNaN(r) && !double.IsInfinity(r)) // remove entries where the original value is 0 258 .ToList(); 256 259 default: throw new NotSupportedException(); 257 260 } -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartViewBase.cs
r15584 r15811 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 22 using System.Drawing; 24 23 using System.Linq; … … 72 71 this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = TARGETVARIABLE_SERIES_NAME; 73 72 this.chart.Series[TARGETVARIABLE_SERIES_NAME].ChartType = SeriesChartType.FastLine; 74 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(), 75 Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray()); 73 74 var rows = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(); 75 var targetValues = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable); 76 77 78 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(rows.ToArray(), targetValues.Select(v => double.IsInfinity(v) ? double.NaN : v).ToArray()); 76 79 // training series 77 80 this.chart.Series.Add(ESTIMATEDVALUES_TRAINING_SERIES_NAME); … … 161 164 var targetValues = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0); 162 165 double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min(); 163 double targetValuesRange = targetValues.Max() - targetValues.Min(); 166 double targetValuesRange = targetValues.Where(v => !double.IsInfinity(v) && !double.IsNaN(v)).Max() - 167 targetValues.Where(v => !double.IsInfinity(v) && !double.IsNaN(v)).Min(); 164 168 double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0)); 165 169 double digits = (int)Math.Log10(interestingValuesRange) - 3; -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.cs
r15584 r15811 126 126 127 127 for (int i = 0; i < solution.ProblemData.Dataset.Rows; i++) { 128 if (double.IsNaN(estimatedValues[i]) || double.IsInfinity(estimatedValues[i])) continue; 129 if (double.IsNaN(targetValues[i]) || double.IsInfinity(targetValues[i])) continue; 128 130 double residual = estimatedValues[i] - targetValues[i]; 129 131 residuals.Add(residual); -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualsLineChartView.cs
r15584 r15811 38 38 var target = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, idx).ToArray(); 39 39 for (int i = 0; i < idx.Length; i++) { 40 x[i] = target[i] - x[i]; 40 if (!double.IsInfinity(target[i]) && !double.IsNaN(target[i]) && 41 !double.IsInfinity(x[i]) && !double.IsNaN(x[i])) { 42 x[i] = target[i] - x[i]; 43 } else { 44 x[i] = 0.0; 45 } 41 46 } 42 47 } -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r15584 r15811 166 166 this.chart.Series[TEST_SERIES].Points.DataBindXY(dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndices).ToArray(), "", 167 167 Content.EstimatedTestValues.ToArray(), ""); 168 double max = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Max(); 169 double min = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Min(); 168 double max = Content.EstimatedTrainingValues 169 .Concat(Content.EstimatedTestValues 170 .Concat(Content.EstimatedValues 171 .Concat(dataset.GetDoubleValues(targetVariableName)))) 172 .Where(v => !double.IsNaN(v) && !double.IsInfinity(v)).Max(); 173 double min = Content.EstimatedTrainingValues 174 .Concat(Content.EstimatedTestValues 175 .Concat(Content.EstimatedValues 176 .Concat(dataset.GetDoubleValues(targetVariableName)))) 177 .Where(v => !double.IsNaN(v) && !double.IsInfinity(v)).Min(); 170 178 171 179 double axisMin, axisMax, axisInterval; -
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/TimeSeriesPrognosis/TimeSeriesPrognosisResidualsLineChartView.cs
r15584 r15811 20 20 #endregion 21 21 22 using System;23 22 using System.Linq; 24 using System.Windows.Forms.DataVisualization.Charting;25 23 using HeuristicLab.MainForm; 26 24
Note: See TracChangeset
for help on using the changeset viewer.