Changeset 6982
- Timestamp:
- 11/10/11 13:04:09 (13 years ago)
- Location:
- trunk/sources
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationEnsembleSolutionEstimatedClassValuesView.cs
r6740 r6982 106 106 values[i, 0] = row.ToString(); 107 107 values[i, 1] = target[i].ToString(); 108 //display only indices and target values if no models are present 109 if (i >= estimatedClassValues.Length) continue; 110 108 111 values[i, 2] = estimatedClassValues[i].ToString(); 109 112 values[i, 3] = (target[i] == estimatedClassValues[i]).ToString(); … … 131 134 matrix.SortableView = true; 132 135 matrixView.Content = matrix; 133 UpdateColoringOfRows();134 136 } 135 137 … … 162 164 return; 163 165 } 164 bool correctClassified = bool.Parse(matrixView.DataGridView[3, e.RowIndex].Value.ToString()); 166 var cellValue = matrixView.DataGridView[3, e.RowIndex].Value.ToString(); 167 if (string.IsNullOrEmpty(cellValue)) return; 168 bool correctClassified = bool.Parse(cellValue); 165 169 matrixView.DataGridView.Rows[e.RowIndex].DefaultCellStyle.ForeColor = correctClassified ? Color.MediumSeaGreen : Color.Red; 166 }167 168 private void UpdateColoringOfRows() {169 if (InvokeRequired) {170 Invoke((Action)UpdateColoringOfRows);171 return;172 }173 //matrixView.DataGridView.SuspendRepaint();174 //for (int i = 0; i < matrixView.DataGridView.Rows.Count; i++) {175 // bool correctClassified = bool.Parse(matrixView.Content.GetValue(i, 3));176 // matrixView.DataGridView.Rows[i].DefaultCellStyle.ForeColor = correctClassified ? Color.MediumSeaGreen : Color.Red;177 //}178 //matrixView.DataGridView.ResumeRepaint(true);179 170 } 180 171 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionErrorCharacteristicsCurveView.cs
r6750 r6982 133 133 series.Points.Clear(); 134 134 residuals.Sort(); 135 if (!residuals.Any() || residuals.All(double.IsNaN)) return; 135 136 136 137 series.Points.AddXY(0, 0); … … 146 147 147 148 point.XValue = residuals[i]; 148 point.YValues[0] = ((double)i +1) / residuals.Count;149 point.YValues[0] = ((double)i + 1) / residuals.Count; 149 150 point.ToolTip = "Error: " + point.XValue + "\n" + "Samples: " + point.YValues[0]; 150 151 series.Points.Add(point); … … 206 207 207 208 private double CalculateAreaOverCurve(Series series) { 208 if (series.Points.Count < 1) throw new ArgumentException("Could not calculate area under curve if less than 1 data points were given.");209 if (series.Points.Count < 1) return 0; 209 210 210 211 double auc = 0.0; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Regression/RegressionSolutionScatterPlotView.cs
r6740 r6982 20 20 #endregion 21 21 using System; 22 using System.Collections.Generic;23 22 using System.Drawing; 24 23 using System.Linq; … … 172 171 string targetVariableName = Content.ProblemData.TargetVariable; 173 172 174 IEnumerable<double>predictedValues = null;175 IEnumerable<double>targetValues = null;173 double[] predictedValues = null; 174 double[] targetValues = null; 176 175 switch (series.Name) { 177 176 case ALL_SERIES: … … 188 187 break; 189 188 } 190 series.Points.DataBindXY(predictedValues, "", targetValues, ""); 189 if (predictedValues.Length == targetValues.Length) 190 series.Points.DataBindXY(predictedValues, "", targetValues, ""); 191 191 this.chart.Legends[series.Legend].ForeColor = Color.Black; 192 192 UpdateCursorInterval(); -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
r6666 r6982 201 201 202 202 public IEnumerable<IEnumerable<double>> GetEstimatedClassValueVectors(Dataset dataset, IEnumerable<int> rows) { 203 if (!Model.Models.Any()) yield break; 203 204 var estimatedValuesEnumerators = (from model in Model.Models 204 205 select model.GetEstimatedClassValues(dataset, rows).GetEnumerator()) -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionEnsembleSolution.cs
r6666 r6982 64 64 private void AfterDeserialization() { 65 65 foreach (var model in Model.Models) { 66 IRegressionProblemData problemData = (IRegressionProblemData) 66 IRegressionProblemData problemData = (IRegressionProblemData)ProblemData.Clone(); 67 67 problemData.TrainingPartition.Start = trainingPartitions[model].Start; 68 68 problemData.TrainingPartition.End = trainingPartitions[model].End; … … 202 202 203 203 public IEnumerable<IEnumerable<double>> GetEstimatedValueVectors(Dataset dataset, IEnumerable<int> rows) { 204 if (!Model.Models.Any()) yield break; 204 205 var estimatedValuesEnumerators = (from model in Model.Models 205 206 select model.GetEstimatedValues(dataset, rows).GetEnumerator())
Note: See TracChangeset
for help on using the changeset viewer.