Changeset 2226 for trunk/sources/HeuristicLab.Modeling
- Timestamp:
- 08/03/09 15:18:36 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Modeling/3.2
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Modeling/3.2/HeuristicLab.Modeling-3.2.csproj
r2041 r2226 83 83 <ItemGroup> 84 84 <Compile Include="ClassificationProblemInjector.cs" /> 85 <Compile Include="DoubleExtensions.cs" /> 85 86 <Compile Include="VariableImpactCalculatorBase.cs" /> 86 87 <Compile Include="VariableEvaluationImpactCalculator.cs" /> -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleEvaluatorBase.cs
r2136 r2226 31 31 32 32 public abstract double Evaluate(double[,] values); 33 34 protected static bool IsAlmost(double x, double y) {35 return Math.Abs(x - y) < 1.0E-12;36 }37 33 } 38 34 } -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleMeanAbsolutePercentageOfRangeErrorEvaluator.cs
r2136 r2226 53 53 double range = Statistics.Range(originalValues); 54 54 if (double.IsInfinity(range)) throw new ArgumentException("Range of elements in values is infinity"); 55 if ( IsAlmost(range,0.0)) throw new ArgumentException("Range of elements in values is zero");55 if (range.IsAlmost(0.0)) throw new ArgumentException("Range of elements in values is zero"); 56 56 57 57 for (int i = 0; i < values.GetLength(0); i++) { -
trunk/sources/HeuristicLab.Modeling/3.2/SimpleVarianceAccountedForEvaluator.cs
r2136 r2226 69 69 double errorsVariance = Statistics.Variance(errors); 70 70 double originalsVariance = Statistics.Variance(originalTargetVariableValues); 71 if ( IsAlmost(originalsVariance,0.0))72 if ( IsAlmost(errorsVariance,0.0)) {71 if (originalsVariance.IsAlmost(0.0)) 72 if (errorsVariance.IsAlmost(0.0)) { 73 73 return 1.0; 74 74 } else { -
trunk/sources/HeuristicLab.Modeling/3.2/VariableEvaluationImpactCalculator.cs
r2165 r2226 64 64 protected override double[] PostProcessImpacts(double[] impacts) { 65 65 double mseSum = impacts.Sum(); 66 if ( IsAlmost(mseSum,0.0)) mseSum = 1.0;66 if (mseSum.IsAlmost(0.0)) mseSum = 1.0; 67 67 for (int i = 0; i < impacts.Length; i++) { 68 68 impacts[i] = impacts[i] / mseSum;
Note: See TracChangeset
for help on using the changeset viewer.