Changeset 8508 for branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs
- Timestamp:
- 08/20/12 17:24:14 (12 years ago)
- Location:
- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Views merged: 7967,7990,8098,8100,8102,8104-8105,8125,8139,8173,8176,8246,8435,8453,8485
- Property svn:mergeinfo changed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs
r7406 r8508 72 72 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].ChartType = SeriesChartType.FastLine; 73 73 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].EmptyPointStyle.Color = this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Color; 74 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TrainingIndi zes.ToArray(), Content.EstimatedTrainingValues.ToArray());74 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TrainingIndices.ToArray(), Content.EstimatedTrainingValues.ToArray()); 75 75 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME]); 76 76 this.chart.Series[ESTIMATEDVALUES_TRAINING_SERIES_NAME].Tag = Content; … … 79 79 this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].LegendText = ESTIMATEDVALUES_TEST_SERIES_NAME; 80 80 this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].ChartType = SeriesChartType.FastLine; 81 this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TestIndi zes.ToArray(), Content.EstimatedTestValues.ToArray());81 this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Points.DataBindXY(Content.ProblemData.TestIndices.ToArray(), Content.EstimatedTestValues.ToArray()); 82 82 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME]); 83 83 this.chart.Series[ESTIMATEDVALUES_TEST_SERIES_NAME].Tag = Content; 84 84 // series of remaining points 85 int[] allIndi zes = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndizes).Except(Content.ProblemData.TestIndizes).ToArray();85 int[] allIndices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray(); 86 86 var estimatedValues = Content.EstimatedValues.ToArray(); 87 List<double> allEstimatedValues = allIndi zes.Select(index => estimatedValues[index]).ToList();87 List<double> allEstimatedValues = allIndices.Select(index => estimatedValues[index]).ToList(); 88 88 this.chart.Series.Add(ESTIMATEDVALUES_ALL_SERIES_NAME); 89 89 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].LegendText = ESTIMATEDVALUES_ALL_SERIES_NAME; 90 90 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].ChartType = SeriesChartType.FastLine; 91 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndizes, allEstimatedValues); 92 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); 91 if (allEstimatedValues.Count > 0) { 92 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndices, allEstimatedValues); 93 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); 94 } 93 95 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Tag = Content; 94 96 this.ToggleSeriesData(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); … … 170 172 171 173 int[] attr = new int[Content.ProblemData.Dataset.Rows + 1]; // add a virtual last row that is again empty to simplify loop further down 172 foreach (var row in Content.ProblemData.TrainingIndi zes) {174 foreach (var row in Content.ProblemData.TrainingIndices) { 173 175 attr[row] += 1; 174 176 } 175 foreach (var row in Content.ProblemData.TestIndi zes) {177 foreach (var row in Content.ProblemData.TestIndices) { 176 178 attr[row] += 2; 177 179 } … … 223 225 string targetVariableName = Content.ProblemData.TargetVariable; 224 226 225 IEnumerable<int> indi zes = null;226 IEnumerable<double>predictedValues = null;227 IEnumerable<int> indices = null; 228 double[] predictedValues = null; 227 229 switch (series.Name) { 228 230 case ESTIMATEDVALUES_ALL_SERIES_NAME: 229 indi zes = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndizes).Except(Content.ProblemData.TestIndizes).ToArray();231 indices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray(); 230 232 var estimatedValues = Content.EstimatedValues.ToArray(); 231 predictedValues = indi zes.Select(index => estimatedValues[index]).ToList();233 predictedValues = indices.Select(index => estimatedValues[index]).ToArray(); 232 234 break; 233 235 case ESTIMATEDVALUES_TRAINING_SERIES_NAME: 234 indi zes = Content.ProblemData.TrainingIndizes.ToArray();236 indices = Content.ProblemData.TrainingIndices.ToArray(); 235 237 predictedValues = Content.EstimatedTrainingValues.ToArray(); 236 238 break; 237 239 case ESTIMATEDVALUES_TEST_SERIES_NAME: 238 indi zes = Content.ProblemData.TestIndizes.ToArray();240 indices = Content.ProblemData.TestIndices.ToArray(); 239 241 predictedValues = Content.EstimatedTestValues.ToArray(); 240 242 break; 241 243 } 242 series.Points.DataBindXY(indizes, predictedValues); 243 this.InsertEmptyPoints(series); 244 if (predictedValues.Length > 0) { 245 series.Points.DataBindXY(indices, predictedValues); 246 this.InsertEmptyPoints(series); 247 } 244 248 chart.Legends[series.Legend].ForeColor = Color.Black; 245 249 UpdateCursorInterval();
Note: See TracChangeset
for help on using the changeset viewer.