Changeset 9845
- Timestamp:
- 08/05/13 09:40:54 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionEstimatedClassValuesView.cs
r9456 r9845 30 30 [Content(typeof(IDiscriminantFunctionClassificationSolution))] 31 31 public partial class DiscriminantFunctionClassificationSolutionEstimatedClassValuesView : ClassificationSolutionEstimatedClassValuesView { 32 private const string TargetClassValuesSeriesname = "TargetVariable"; 33 private const string EstimatedClassValuesSeriesName = "EstimatedClassValues"; 34 private const string EstimatedValuesSeriesName = "EstimatedValues"; 32 private const string TARGETVARIABLE_SERIES_NAME = "TargetVariable"; 33 private const string ESTIMATEDVALUES_SERIES_NAME = "Estimated Class Values (all)"; 34 private const string ESTIMATEDVALUES_TRAINING_SERIES_NAME = "Estimated Class Values (training)"; 35 private const string ESTIMATEDVALUES_TEST_SERIES_NAME = "Estimated Class Values (test)"; 36 private const string ESTIMATEDVALUES_DISCRIMINANT_SERIES_NAME = "Discriminant Values (all)"; 35 37 36 38 public new IDiscriminantFunctionClassificationSolution Content { … … 49 51 StringMatrix matrix = null; 50 52 if (Content != null) { 51 string[,] values = new string[Content.ProblemData.Dataset.Rows, 4]; 52 53 string[,] values = new string[Content.ProblemData.Dataset.Rows, 6]; 53 54 double[] target = Content.ProblemData.Dataset.GetDoubleValues(Content.ProblemData.TargetVariable).ToArray(); 54 double[] estimatedClassValue s= Content.EstimatedClassValues.ToArray();55 double[] estimatedClassValue = Content.EstimatedClassValues.ToArray(); 55 56 double[] estimatedValues = Content.EstimatedValues.ToArray(); 56 57 for (int row = 0; row < target.Length; row++) { 57 58 values[row, 0] = row.ToString(); 58 59 values[row, 1] = target[row].ToString(); 59 values[row, 2] = estimatedClassValues[row].ToString(); 60 values[row, 3] = estimatedValues[row].ToString(); 60 values[row, 2] = estimatedClassValue[row].ToString(); 61 values[row, 5] = estimatedValues[row].ToString(); 62 } 63 64 var estimatedTraining = Content.EstimatedTrainingClassValues.GetEnumerator(); 65 estimatedTraining.MoveNext(); 66 foreach (var trainingRow in Content.ProblemData.TrainingIndices) { 67 values[trainingRow, 3] = estimatedTraining.Current.ToString(); 68 estimatedTraining.MoveNext(); 69 } 70 var estimatedTest = Content.EstimatedTestClassValues.GetEnumerator(); 71 estimatedTest.MoveNext(); 72 foreach (var testRow in Content.ProblemData.TestIndices) { 73 values[testRow, 4] = estimatedTest.Current.ToString(); 74 estimatedTest.MoveNext(); 61 75 } 62 76 63 77 matrix = new StringMatrix(values); 64 matrix.ColumnNames = new string[] { "Id", T argetClassValuesSeriesname, EstimatedClassValuesSeriesName, EstimatedValuesSeriesName};78 matrix.ColumnNames = new string[] { "Id", TARGETVARIABLE_SERIES_NAME, ESTIMATEDVALUES_SERIES_NAME, ESTIMATEDVALUES_TRAINING_SERIES_NAME, ESTIMATEDVALUES_TEST_SERIES_NAME, ESTIMATEDVALUES_DISCRIMINANT_SERIES_NAME }; 65 79 matrix.SortableView = true; 66 80 }
Note: See TracChangeset
for help on using the changeset viewer.