Changeset 2136 for trunk/sources/HeuristicLab.GP.StructureIdentification
- Timestamp:
- 07/06/09 17:12:37 (16 years ago)
- Location:
- trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/CoefficientOfDeterminationEvaluator.cs
r1894 r2136 37 37 } 38 38 } 39 39 40 40 public override string Description { 41 41 get { … … 46 46 47 47 public override double Evaluate(double[,] values) { 48 49 double quality =SimpleR2Evaluator.Calculate(values);50 if (double.IsNaN(quality) || double.IsInfinity(quality))51 quality = double.MaxValue;52 53 return quality;48 try { 49 return SimpleR2Evaluator.Calculate(values); 50 } 51 catch (ArgumentException) { 52 return double.NegativeInfinity; 53 } 54 54 } 55 55 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageErrorEvaluator.cs
r1894 r2136 46 46 47 47 public override double Evaluate(double[,] values) { 48 double quality = SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(values); 49 if (double.IsNaN(quality) || double.IsInfinity(quality)) 50 quality = double.MaxValue; 51 52 return quality; 48 try { 49 return SimpleMeanAbsolutePercentageErrorEvaluator.Calculate(values); 50 } 51 catch (ArgumentException) { 52 return double.PositiveInfinity; 53 } 53 54 } 54 55 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanAbsolutePercentageOfRangeErrorEvaluator.cs
r1894 r2136 45 45 46 46 public override double Evaluate(double[,] values) { 47 double quality = SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.Calculate(values); 48 if (double.IsNaN(quality) || double.IsInfinity(quality)) 49 quality = double.MaxValue; 50 51 return quality; 47 try { return SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.Calculate(values); } 48 catch (ArgumentException) { 49 return double.PositiveInfinity; 50 } 52 51 } 53 52 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/MeanSquaredErrorEvaluator.cs
r1894 r2136 45 45 46 46 public override double Evaluate(double[,] values) { 47 double quality = SimpleMSEEvaluator.Calculate(values); 48 49 if (double.IsNaN(quality) || double.IsInfinity(quality)) { 50 quality = double.MaxValue; 47 try { return SimpleMSEEvaluator.Calculate(values); } 48 catch (ArgumentException) { 49 return double.PositiveInfinity; 51 50 } 52 53 return quality;54 51 } 55 52 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VariableQualityImpactCalculator.cs
r2043 r2136 46 46 evaluator.PrepareForEvaluation(dataset, targetVariable, start, end, punishmentFactor, tree); 47 47 48 double[,] result = new double[end - start, 2];48 double[,] result = new double[end - start, 2]; 49 49 for (int i = start; i < end; i++) { 50 50 result[i - start, 0] = dataset.GetValue(i, targetVariable); 51 result[i - start, 1] = evaluator.Evaluate(i);51 result[i - start, 1] = evaluator.Evaluate(i); 52 52 } 53 53 54 return HeuristicLab.Modeling.SimpleMSEEvaluator.Calculate(result); 54 try { 55 return HeuristicLab.Modeling.SimpleMSEEvaluator.Calculate(result); 56 } 57 catch (ArgumentException) { 58 return double.PositiveInfinity; 59 } 55 60 } 56 61 } -
trunk/sources/HeuristicLab.GP.StructureIdentification/3.3/Evaluators/VarianceAccountedForEvaluator.cs
r1894 r2136 54 54 55 55 public override double Evaluate(double[,] values) { 56 double quality = SimpleVarianceAccountedForEvaluator.Calculate(values); 57 58 if (double.IsNaN(quality) || double.IsInfinity(quality)) { 59 quality = double.MaxValue; 56 try { return SimpleVarianceAccountedForEvaluator.Calculate(values); } 57 catch (ArgumentException) { 58 return double.NegativeInfinity; 60 59 } 61 return quality;62 60 } 63 61 }
Note: See TracChangeset
for help on using the changeset viewer.