Changeset 4469 for branches/HeuristicLab.Classification/HeuristicLab.Problems.DataAnalysis.Classification.Views/3.3/RocCurvesView.cs
- Timestamp:
- 09/22/10 12:14:38 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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) {
Note: See TracChangeset
for help on using the changeset viewer.