Changeset 8101 for branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AverageThresholdCalculator.cs
- Timestamp:
- 06/25/12 13:11:18 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AverageThresholdCalculator.cs
r7729 r8101 57 57 } 58 58 59 protected override double DiscriminantAggregateEstimatedClassValues(IDictionary<IClassificationSolution, double> estimatedClassValues, IDictionary<IDiscriminantFunctionClassificationSolution, double> estimatedValues) {60 IList<double> values = estimatedValues.Select(x => x.Value).ToList();61 if (values.Count <= 0)62 return double.NaN;63 double avg = values.Average();64 return GetClassValueToAverage(avg);65 }66 private double GetClassValueToAverage(double avg) {67 double classValue = classValues.First();68 for (int i = 0; i < classValues.Count(); i++) {69 if (avg > threshold[i])70 classValue = classValues[i];71 else72 break;73 }74 return classValue;75 }76 77 59 protected override double GetDiscriminantConfidence(IEnumerable<IDiscriminantFunctionClassificationSolution> solutions, int index, double estimatedClassValue) { 78 60 // only works with binary classification
Note: See TracChangeset
for help on using the changeset viewer.