- Timestamp:
- 02/19/18 16:32:54 (7 years ago)
- Location:
- trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartViewBase.cs
r15583 r15785 72 72 this.chart.Series[TARGETVARIABLE_SERIES_NAME].LegendText = TARGETVARIABLE_SERIES_NAME; 73 73 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()); 74 75 var rows = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).ToArray(); 76 var targetVariables = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray(); 77 List<int> xVals = new List<int>(); 78 List<double> yVals = new List<double>(); 79 80 for (int i = 0; i < rows.Length; i++) { 81 if (!double.IsInfinity(targetVariables[i])) { 82 xVals.Add(rows[i]); 83 yVals.Add(targetVariables[i]); 84 } 85 } 86 87 this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.DataBindXY(xVals.ToArray(), yVals.ToArray()); 76 88 // training series 77 89 this.chart.Series.Add(ESTIMATEDVALUES_TRAINING_SERIES_NAME); … … 161 173 var targetValues = this.chart.Series[TARGETVARIABLE_SERIES_NAME].Points.Select(x => x.YValues[0]).DefaultIfEmpty(1.0); 162 174 double estimatedValuesRange = estimatedValues.Max() - estimatedValues.Min(); 163 double targetValuesRange = targetValues. Max() - targetValues.Min();175 double targetValuesRange = targetValues.Where(v => !double.IsInfinity(v)).Max() - targetValues.Where(v => !double.IsNaN(v) && !double.IsNegativeInfinity(v)).Min(); 164 176 double interestingValuesRange = Math.Min(Math.Max(targetValuesRange, 1.0), Math.Max(estimatedValuesRange, 1.0)); 165 177 double digits = (int)Math.Log10(interestingValuesRange) - 3; -
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualHistogram.cs
r15583 r15785 81 81 if (Content != null) { 82 82 List<double> residuals = CalculateResiduals(Content); 83 residuals.Remove(double.NaN); 84 residuals.Remove(double.PositiveInfinity); 85 residuals.Remove(double.NegativeInfinity); 83 86 84 87 double max = 0.0; -
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionResidualsLineChartView.cs
r15583 r15785 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])) { 41 x[i] = target[i] - x[i]; 42 } 41 43 } 42 44 } -
trunk/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r15583 r15785 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.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Where(v => !double.IsInfinity(v)).Max(); 169 double min = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Where(v => !double.IsNaN(v) && !double.IsNegativeInfinity(v)).Min(); 170 170 171 171 double axisMin, axisMax, axisInterval;
Note: See TracChangeset
for help on using the changeset viewer.