- Timestamp:
- 05/23/11 16:13:43 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/ClassificationSolutionEstimatedClassValuesView.cs
r6239 r6255 33 33 public partial class ClassificationSolutionEstimatedClassValuesView : ItemView, IClassificationSolutionEvaluationView { 34 34 private const string TARGETVARIABLE_SERIES_NAME = "Target Variable"; 35 private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Class Values (all)"; 35 36 private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Class Values (training)"; 36 37 private const string ESTIMATEDVALUES_TEST_SERIES_NAME = "Estimated Class Values (test)"; … … 84 85 if (InvokeRequired) Invoke((Action)UpdateEstimatedValues); 85 86 else { 86 DoubleMatrix matrix = null;87 StringMatrix matrix = null; 87 88 if (Content != null) { 88 double[,] values = new double[Content.ProblemData.Dataset.Rows, 3]; 89 // fill with NaN 90 for (int row = 0; row < Content.ProblemData.Dataset.Rows; row++) 91 for (int column = 0; column < 3; column++) 92 values[row, column] = double.NaN; 89 string[,] values = new string[Content.ProblemData.Dataset.Rows, 5]; 93 90 94 91 double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable); 92 double[] estimated = Content.EstimatedClassValues.ToArray(); 95 93 for (int row = 0; row < target.Length; row++) { 96 values[row, 0] = target[row]; 94 values[row, 0] = row.ToString(); 95 values[row, 1] = target[row].ToString(); 96 values[row, 2] = estimated[row].ToString(); 97 97 } 98 98 99 var estimatedTraining = Content.EstimatedTrainingClassValues.GetEnumerator(); 99 100 estimatedTraining.MoveNext(); 100 101 foreach (var trainingRow in Content.ProblemData.TrainingIndizes) { 101 values[trainingRow, 1] = estimatedTraining.Current;102 values[trainingRow, 3] = estimatedTraining.Current.ToString(); 102 103 estimatedTraining.MoveNext(); 103 104 } … … 105 106 estimatedTest.MoveNext(); 106 107 foreach (var testRow in Content.ProblemData.TestIndizes) { 107 values[testRow, 2] = estimatedTest.Current;108 values[testRow, 4] = estimatedTest.Current.ToString(); 108 109 estimatedTest.MoveNext(); 109 110 } 110 111 111 matrix = new DoubleMatrix(values); 112 matrix.ColumnNames = new string[] { TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME }; 112 matrix = new StringMatrix(values); 113 matrix.ColumnNames = new string[] {"Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME }; 114 matrix.SortableView = true; 113 115 } 114 116 matrixView.Content = matrix; -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionEstimatedClassValuesView.cs
r5975 r6255 84 84 if (InvokeRequired) Invoke((Action)UpdateEstimatedValues); 85 85 else { 86 DoubleMatrix matrix = null;86 StringMatrix matrix = null; 87 87 if (Content != null) { 88 double[,] values = new double[Content.ProblemData.Dataset.Rows, 3];88 string[,] values = new string[Content.ProblemData.Dataset.Rows, 5]; 89 89 90 90 double[] target = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable); … … 92 92 double[] estimatedValues = Content.EstimatedValues.ToArray(); 93 93 for (int row = 0; row < target.Length; row++) { 94 values[row, 0] = target[row]; 95 values[row, 1] = estimatedClassValues[row]; 96 values[row, 2] = estimatedValues[row]; 94 values[row, 0] = row.ToString(); 95 values[row, 1] = target[row].ToString(); 96 values[row, 2] = estimatedClassValues[row].ToString(); 97 values[row, 3] = estimatedValues[row].ToString(); 97 98 } 98 99 99 matrix = new DoubleMatrix(values); 100 matrix.ColumnNames = new string[] { TargetClassValuesSeriesname, EstimatedClassValuesSeriesName, EstimatedValuesSeriesName }; 100 matrix = new StringMatrix(values); 101 matrix.ColumnNames = new string[] { "Id", TargetClassValuesSeriesname, EstimatedClassValuesSeriesName, EstimatedValuesSeriesName }; 102 matrix.SortableView = true; 101 103 } 102 104 matrixView.Content = matrix;
Note: See TracChangeset
for help on using the changeset viewer.