Changeset 8331 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators
- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 8113,8121,8126,8139,8151-8153,8167,8174,8246
- Property svn:mergeinfo changed
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators/AccuracyMaximizationThresholdCalculator.cs
r7259 r8331 54 54 public static void CalculateThresholds(IClassificationProblemData problemData, IEnumerable<double> estimatedValues, IEnumerable<double> targetClassValues, out double[] classValues, out double[] thresholds) { 55 55 int slices = 100; 56 double minThresholdInc = 10e-5; // necessary to prevent infinite loop when maxEstimated - minEstimated is effectively zero (constant model) 56 57 List<double> estimatedValuesList = estimatedValues.ToList(); 57 58 double maxEstimatedValue = estimatedValuesList.Max(); 58 59 double minEstimatedValue = estimatedValuesList.Min(); 59 double thresholdIncrement = (maxEstimatedValue - minEstimatedValue) / slices;60 double thresholdIncrement = Math.Max((maxEstimatedValue - minEstimatedValue) / slices, minThresholdInc); 60 61 var estimatedAndTargetValuePairs = 61 62 estimatedValuesList.Zip(targetClassValues, (x, y) => new { EstimatedValue = x, TargetClassValue = y }) … … 70 71 71 72 // incrementally calculate accuracy of all possible thresholds 72 int[,] confusionMatrix = new int[nClasses, nClasses];73 74 73 for (int i = 1; i < thresholds.Length; i++) { 75 74 double lowerThreshold = thresholds[i - 1];
Note: See TracChangeset
for help on using the changeset viewer.