Changeset 12448 for branches/SensitivityEvaluator/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators
- Timestamp:
- 06/15/15 17:00:37 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SensitivityEvaluator/HeuristicLab.Problems.DataAnalysis/3.4/OnlineCalculators/OnlineWeightedResidualsMeanSquaredErrorCalculator.cs
r12416 r12448 36 36 37 37 public double PositiveClassValue { get; private set; } 38 public double ClassValue Max { get; private set; }39 public double ClassValue Min { get; private set; }40 public double ObviousResidualsWeight { get; private set; }38 public double ClassValuesMax { get; private set; } 39 public double ClassValuesMin { get; private set; } 40 public double DefiniteResidualsWeight { get; private set; } 41 41 public double PositiveClassResidualsWeight { get; private set; } 42 public double NegativeClass ResidualsWeight { get; private set; }42 public double NegativeClassesResidualsWeight { get; private set; } 43 43 44 public OnlineWeightedResidualsMeanSquaredErrorCalculator(double positiveClassValue, double classValue Max, double classValueMin,45 double obviousResidualsWeight, double positiveClassResidualsWeight, double negativeClassResidualsWeight) {44 public OnlineWeightedResidualsMeanSquaredErrorCalculator(double positiveClassValue, double classValuesMax, double classValuesMin, 45 double definiteResidualsWeight, double positiveClassResidualsWeight, double negativeClassesResidualsWeight) { 46 46 PositiveClassValue = positiveClassValue; 47 ClassValue Max = classValueMax;48 ClassValue Min = classValueMin;49 ObviousResidualsWeight = obviousResidualsWeight;47 ClassValuesMax = classValuesMax; 48 ClassValuesMin = classValuesMin; 49 DefiniteResidualsWeight = definiteResidualsWeight; 50 50 PositiveClassResidualsWeight = positiveClassResidualsWeight; 51 NegativeClass ResidualsWeight = negativeClassResidualsWeight;51 NegativeClassesResidualsWeight = negativeClassesResidualsWeight; 52 52 Reset(); 53 53 } … … 75 75 double weight; 76 76 //apply weight 77 if (estimated > ClassValueMax || estimated < ClassValueMin) { 78 weight = ObviousResidualsWeight; 79 } else if (original.IsAlmost(PositiveClassValue)) 80 { 77 if (estimated > ClassValuesMax || estimated < ClassValuesMin) { 78 weight = DefiniteResidualsWeight; 79 } else if (original.IsAlmost(PositiveClassValue)) { 81 80 weight = PositiveClassResidualsWeight; 82 } else 83 { 84 weight = NegativeClassResidualsWeight; 81 } else { 82 weight = NegativeClassesResidualsWeight; 85 83 } 86 84 error *= weight; … … 92 90 #endregion 93 91 94 public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, double positiveClassValue, double classValue Max, double classValueMin,95 double obviousValuesWeight, double positiveClassValuesWeight, double negativeClassValuesWeight, out OnlineCalculatorError errorState) {92 public static double Calculate(IEnumerable<double> originalValues, IEnumerable<double> estimatedValues, double positiveClassValue, double classValuesMax, double classValuesMin, 93 double definiteResidualsWeight, double positiveClassResidualsWeight, double negativeClassesResidualsWeight, out OnlineCalculatorError errorState) { 96 94 IEnumerator<double> originalEnumerator = originalValues.GetEnumerator(); 97 95 IEnumerator<double> estimatedEnumerator = estimatedValues.GetEnumerator(); 98 OnlineWeightedResidualsMeanSquaredErrorCalculator calculator = new OnlineWeightedResidualsMeanSquaredErrorCalculator(positiveClassValue, classValue Max, classValueMin, obviousValuesWeight, positiveClassValuesWeight, negativeClassValuesWeight);96 OnlineWeightedResidualsMeanSquaredErrorCalculator calculator = new OnlineWeightedResidualsMeanSquaredErrorCalculator(positiveClassValue, classValuesMax, classValuesMin, definiteResidualsWeight, positiveClassResidualsWeight, negativeClassesResidualsWeight); 99 97 100 98 // always move forward both enumerators (do not use short-circuit evaluation!)
Note: See TracChangeset
for help on using the changeset viewer.