Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/21/12 16:44:20 (13 years ago)
Author:
sforsten
Message:

#1776:

  • improvements in the usage of the WeightCalculators
  • small changes in all class which inherit from the WeightCalculator class
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ClassificationEnsembleVoting/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Classification/WeightCalculators/AccuracyWeightCalculator.cs

    r7464 r7504  
    4848    }
    4949
    50     public override IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
    51       double sum = classificationSolutions.Select(s => s.TestAccuracy).Sum();
    52       List<double> weights = new List<double>();
    53       foreach (var item in classificationSolutions) {
    54         weights.Add(item.TestAccuracy / sum);
    55       }
    56       return weights;
     50    protected override IEnumerable<double> CalculateWeights(ItemCollection<IClassificationSolution> classificationSolutions) {
     51      return classificationSolutions.Select(s => s.TrainingAccuracy);
    5752    }
    5853  }
Note: See TracChangeset for help on using the changeset viewer.