Changeset 8101 for branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation
- Timestamp:
- 06/25/12 13:11:18 (13 years ago)
- Location:
- branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/ClassificationEnsembleSolution.cs
r7596 r8101 56 56 if (value != null) { 57 57 weightCalculator = value; 58 if (!ProblemData.IsEmpty) 58 if (!ProblemData.IsEmpty) { 59 59 RecalculateResults(); 60 } 60 61 } 61 62 } -
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 -
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/DiscriminantClassificationWeightCalculator.cs
r7729 r8101 66 66 67 67 protected virtual double DiscriminantAggregateEstimatedClassValues(IDictionary<IClassificationSolution, double> estimatedClassValues, IDictionary<IDiscriminantFunctionClassificationSolution, double> estimatedValues) { 68 return AggregateEstimatedClassValues(estimatedClassValues);68 return base.AggregateEstimatedClassValues(estimatedClassValues); 69 69 } 70 70 -
branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/MedianThresholdCalculator.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 median = GetMedian(values);64 return GetClassValueToMedian(median);65 }66 private double GetClassValueToMedian(double median) {67 double classValue = classValues.First();68 for (int i = 0; i < classValues.Count(); i++) {69 if (median > 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 … … 106 88 } 107 89 108 pr ivatedouble GetMedian(IList<double> estimatedValues) {90 protected double GetMedian(IList<double> estimatedValues) { 109 91 int count = estimatedValues.Count; 110 92 if (count % 2 == 0)
Note: See TracChangeset
for help on using the changeset viewer.