Changeset 4469 for branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification.Views
- Timestamp:
- 09/22/10 12:14:38 (14 years ago)
- Location:
- branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification.Views/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification.Views/3.3/ConfusionMatrixView.cs
r4417 r4469 105 105 106 106 double[,] confusionMatrix = new double[Content.ProblemData.NumberOfClasses, Content.ProblemData.NumberOfClasses]; 107 int start; 108 int end; 107 IEnumerable<int> rows; 109 108 110 109 if (cmbSamples.SelectedItem.ToString() == TrainingSamples) { 111 start = Content.ProblemData.TrainingSamplesStart.Value; 112 end = Content.ProblemData.TrainingSamplesEnd.Value; 110 rows = Content.ProblemData.TrainingIndizes; 113 111 } else if (cmbSamples.SelectedItem.ToString() == TestSamples) { 114 start = Content.ProblemData.TestSamplesStart.Value; 115 end = Content.ProblemData.TestSamplesEnd.Value; 112 rows = Content.ProblemData.TestIndizes; 116 113 } else throw new InvalidOperationException(); 117 114 … … 123 120 } 124 121 125 double[] targetValues = Content.ProblemData.Dataset.Get VariableValues(Content.ProblemData.TargetVariable.Value, start, end);126 double[] predictedValues = Content. EstimatedClassValues.Skip(start).Take(end - start).ToArray();122 double[] targetValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, rows).ToArray(); 123 double[] predictedValues = Content.GetEstimatedClassValues(rows).ToArray(); 127 124 128 125 for (int i = 0; i < targetValues.Length; i++) { -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification.Views/3.3/RocCurvesView.cs
r4417 r4469 97 97 98 98 int slices = 100; 99 int samplesStart = Content.ProblemData.TrainingSamplesStart.Value; 100 int samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value; 99 IEnumerable<int> rows; 101 100 102 101 if (cmbSamples.SelectedItem.ToString() == TrainingSamples) { 103 samplesStart = Content.ProblemData.TrainingSamplesStart.Value; 104 samplesEnd = Content.ProblemData.TrainingSamplesEnd.Value; 102 rows = Content.ProblemData.TrainingIndizes; 105 103 } else if (cmbSamples.SelectedItem.ToString() == TestSamples) { 106 samplesStart = Content.ProblemData.TestSamplesStart.Value; 107 samplesEnd = Content.ProblemData.TestSamplesEnd.Value; 104 rows = Content.ProblemData.TestIndizes; 108 105 } else throw new InvalidOperationException(); 109 106 110 double[] estimatedValues = Content.EstimatedValues.Skip(samplesStart).Take(samplesEnd - samplesStart).ToArray(); 111 double[] targetClassValues = Content.ProblemData.Dataset.GetVariableValues(Content.ProblemData.TargetVariable.Value) 112 .Skip(samplesStart).Take(samplesEnd - samplesStart).ToArray(); 107 double[] estimatedValues = Content.GetEstimatedValues(rows).ToArray(); 108 double[] targetClassValues = Content.ProblemData.Dataset.GetEnumeratedVariableValues(Content.ProblemData.TargetVariable.Value, rows).ToArray(); 113 109 double minThreshold = estimatedValues.Min(); 114 110 double maxThreshold = estimatedValues.Max(); … … 122 118 List<ROCPoint> rocPoints = new List<ROCPoint>(); 123 119 int positives = targetClassValues.Where(c => c.IsAlmost(classValue)).Count(); 124 int negatives = samplesEnd - samplesStart- positives;120 int negatives = targetClassValues.Length - positives; 125 121 126 122 for (double lowerThreshold = minThreshold; lowerThreshold < maxThreshold; lowerThreshold += thresholdIncrement) { -
branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification.Views/3.3/SymbolicClassificationSolutionView.cs
r4417 r4469 134 134 135 135 private void FillSeriesWithDataPoints(Series series) { 136 int row = Content.ProblemData.TrainingSamplesStart.Value; 137 foreach (double estimatedValue in Content.EstimatedTrainingValues) { 136 List<double> estimatedValues = Content.EstimatedValues.ToList(); 137 foreach (int row in Content.ProblemData.TrainingIndizes) { 138 double estimatedValue = estimatedValues[row]; 138 139 double targetValue = Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value, row]; 139 if (targetValue == (double)series.Tag) {140 if (targetValue.IsAlmost((double)series.Tag)) { 140 141 double jitterValue = random.NextDouble() * 2.0 - 1.0; 141 142 DataPoint point = new DataPoint(); … … 145 146 series.Points.Add(point); 146 147 } 147 row++; 148 } 149 150 row = Content.ProblemData.TestSamplesStart.Value; 151 foreach (double estimatedValue in Content.EstimatedTestValues) { 148 } 149 150 foreach (int row in Content.ProblemData.TestIndizes) { 151 double estimatedValue = estimatedValues[row]; 152 152 double targetValue = Content.ProblemData.Dataset[Content.ProblemData.TargetVariable.Value, row]; 153 153 if (targetValue == (double)series.Tag) { … … 159 159 series.Points.Add(point); 160 160 } 161 row++;162 } 161 } 162 163 163 UpdateCursorInterval(); 164 164 }
Note: See TracChangeset
for help on using the changeset viewer.