Exemple #1
0
        /// <summary>
        /// Recalculate the scores of each peak by applying the given feature weighting factors.
        /// </summary>
        /// <param name="weights">Array of weight factors applied to each feature.</param>
        /// <returns>Mean peak score.</returns>
        public void ScorePeaks(IList <double> weights)
        {
            foreach (var peak in _scoredGroupPeaksList.SelectMany(scoredGroupPeaks => scoredGroupPeaks.ScoredPeaks))
            {
                peak.Score = LinearModelParams.Score(peak.Features, weights, 0);
            }

            // Calculate mean and stdev for top-scoring peaks in each transition group.
            var scores = GetMaxScores();
            var stats  = new Statistics(scores);

            Mean  = stats.Mean();
            Stdev = stats.StdDev();
        }
Exemple #2
0
 public ScoredPeak CalcScore(IList <double> weights)
 {
     return(new ScoredPeak(Features, LinearModelParams.Score(Features, weights, 0)));
 }
 public static double Score(IList <float> features, LinearModelParams parameters)
 {
     return(parameters.Score(features));
 }
 /// <summary>
 /// Calculate the score of a set of features given an array of weighting coefficients.
 /// </summary>
 private static double GetScore(IList <double> weights, PeakGroupFeatures peakGroupFeatures, double bias)
 {
     return(LinearModelParams.Score(peakGroupFeatures.Features, weights, bias));
 }