Changeset 8126
- Timestamp:
- 06/26/12 15:29:45 (12 years ago)
- Location:
- trunk/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTree.cs
r7795 r8126 23 23 using System.Collections.Generic; 24 24 using System.Drawing; 25 using System.Linq; 25 26 using HeuristicLab.Common; 26 27 using HeuristicLab.Core; … … 77 78 public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesBreadth() { 78 79 if (root == null) 79 return new SymbolicExpressionTreeNode[0];80 return Enumerable.Empty<SymbolicExpressionTreeNode>(); 80 81 return root.IterateNodesBreadth(); 81 82 } … … 83 84 public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPrefix() { 84 85 if (root == null) 85 return new SymbolicExpressionTreeNode[0];86 return Enumerable.Empty<SymbolicExpressionTreeNode>(); 86 87 return root.IterateNodesPrefix(); 87 88 } 88 89 public IEnumerable<ISymbolicExpressionTreeNode> IterateNodesPostfix() { 89 90 if (root == null) 90 return new SymbolicExpressionTreeNode[0];91 return Enumerable.Empty<SymbolicExpressionTreeNode>(); 91 92 return root.IterateNodesPostfix(); 92 93 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveTrainingParetoBestSolutionAnalyzer.cs
r7734 r8126 100 100 101 101 List<double> complexities; 102 if (ComplexityParameter.ActualValue != null ) {102 if (ComplexityParameter.ActualValue != null && ComplexityParameter.ActualValue.Length == qualities.Count) { 103 103 complexities = ComplexityParameter.ActualValue.Select(x => x.Value).ToList(); 104 104 } else { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisSingleObjectiveValidationParetoBestSolutionAnalyzer.cs
r7734 r8126 137 137 138 138 List<double> complexities; 139 if (ComplexityParameter.ActualValue != null ) {139 if (ComplexityParameter.ActualValue != null && ComplexityParameter.ActualValue.Length == trainingQuality.Length) { 140 140 complexities = ComplexityParameter.ActualValue.Select(x => x.Value).ToList(); 141 141 } else { -
trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ThresholdCalculators/AccuracyMaximizationThresholdCalculator.cs
r7259 r8126 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.