- Timestamp:
- 06/27/12 17:34:17 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r8105 r8139 169 169 switch (cmbSamples.SelectedItem.ToString()) { 170 170 case TrainingSamples: 171 originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes);171 originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices); 172 172 break; 173 173 case TestSamples: 174 originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndi zes);174 originalValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TestIndices); 175 175 break; 176 176 case AllSamples: … … 234 234 235 235 private IRegressionSolution CreateConstantModel() { 236 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndi zes).Average();236 double averageTrainingTarget = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariable, ProblemData.TrainingIndices).Average(); 237 237 var solution = new ConstantRegressionModel(averageTrainingTarget).CreateRegressionSolution(ProblemData); 238 238 solution.Name = "Baseline"; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionEstimatedValuesView.cs
r7259 r8139 93 93 var estimated_test = Content.EstimatedTestValues.GetEnumerator(); 94 94 95 foreach (var row in Content.ProblemData.TrainingIndi zes) {95 foreach (var row in Content.ProblemData.TrainingIndices) { 96 96 estimated_training.MoveNext(); 97 97 values[row, 3] = estimated_training.Current.ToString(); 98 98 } 99 99 100 foreach (var row in Content.ProblemData.TestIndi zes) {100 foreach (var row in Content.ProblemData.TestIndices) { 101 101 estimated_test.MoveNext(); 102 102 values[row, 4] = estimated_test.Current.ToString(); -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionLineChartView.cs
r7406 r8139 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(allIndi zes, allEstimatedValues);91 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Points.DataBindXY(allIndices, allEstimatedValues); 92 92 this.InsertEmptyPoints(this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME]); 93 93 this.chart.Series[ESTIMATEDVALUES_ALL_SERIES_NAME].Tag = Content; … … 170 170 171 171 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) {172 foreach (var row in Content.ProblemData.TrainingIndices) { 173 173 attr[row] += 1; 174 174 } 175 foreach (var row in Content.ProblemData.TestIndi zes) {175 foreach (var row in Content.ProblemData.TestIndices) { 176 176 attr[row] += 2; 177 177 } … … 223 223 string targetVariableName = Content.ProblemData.TargetVariable; 224 224 225 IEnumerable<int> indi zes = null;225 IEnumerable<int> indices = null; 226 226 IEnumerable<double> predictedValues = null; 227 227 switch (series.Name) { 228 228 case ESTIMATEDVALUES_ALL_SERIES_NAME: 229 indi zes = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndizes).Except(Content.ProblemData.TestIndizes).ToArray();229 indices = Enumerable.Range(0, Content.ProblemData.Dataset.Rows).Except(Content.ProblemData.TrainingIndices).Except(Content.ProblemData.TestIndices).ToArray(); 230 230 var estimatedValues = Content.EstimatedValues.ToArray(); 231 predictedValues = indi zes.Select(index => estimatedValues[index]).ToList();231 predictedValues = indices.Select(index => estimatedValues[index]).ToList(); 232 232 break; 233 233 case ESTIMATEDVALUES_TRAINING_SERIES_NAME: 234 indi zes = Content.ProblemData.TrainingIndizes.ToArray();234 indices = Content.ProblemData.TrainingIndices.ToArray(); 235 235 predictedValues = Content.EstimatedTrainingValues.ToArray(); 236 236 break; 237 237 case ESTIMATEDVALUES_TEST_SERIES_NAME: 238 indi zes = Content.ProblemData.TestIndizes.ToArray();238 indices = Content.ProblemData.TestIndices.ToArray(); 239 239 predictedValues = Content.EstimatedTestValues.ToArray(); 240 240 break; 241 241 } 242 series.Points.DataBindXY(indi zes, predictedValues);242 series.Points.DataBindXY(indices, predictedValues); 243 243 this.InsertEmptyPoints(series); 244 244 chart.Legends[series.Legend].ForeColor = Color.Black; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r7990 r8139 148 148 if (this.chart.Series[TRAINING_SERIES].Points.Count > 0) 149 149 this.chart.Series[TRAINING_SERIES].Points.DataBindXY(Content.EstimatedTrainingValues.ToArray(), "", 150 dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndi zes).ToArray(), "");150 dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndices).ToArray(), ""); 151 151 if (this.chart.Series[TEST_SERIES].Points.Count > 0) 152 152 this.chart.Series[TEST_SERIES].Points.DataBindXY(Content.EstimatedTestValues.ToArray(), "", 153 dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndi zes).ToArray(), "");153 dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndices).ToArray(), ""); 154 154 155 155 double max = Content.EstimatedTrainingValues.Concat(Content.EstimatedTestValues.Concat(Content.EstimatedValues.Concat(dataset.GetDoubleValues(targetVariableName)))).Max(); … … 196 196 case TRAINING_SERIES: 197 197 predictedValues = Content.EstimatedTrainingValues.ToArray(); 198 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndi zes).ToArray();198 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TrainingIndices).ToArray(); 199 199 break; 200 200 case TEST_SERIES: 201 201 predictedValues = Content.EstimatedTestValues.ToArray(); 202 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndi zes).ToArray();202 targetValues = Content.ProblemData.Dataset.GetDoubleValues(targetVariableName, Content.ProblemData.TestIndices).ToArray(); 203 203 break; 204 204 }
Note: See TracChangeset
for help on using the changeset viewer.