Exemple #1
0
        public virtual ICounter <L> ScoresOf(IDatum <L, F> example)
        {
            ICounter <L> scores = new ClassicCounter <L>();

            foreach (L label in labelIndex)
            {
                IDictionary <L, string> posLabelMap = new ArrayMap <L, string>();
                posLabelMap[label] = PosLabel;
                IDatum <string, F>      binDatum         = GeneralDataset.MapDatum(example, posLabelMap, NegLabel);
                IClassifier <string, F> binaryClassifier = GetBinaryClassifier(label);
                ICounter <string>       binScores        = binaryClassifier.ScoresOf(binDatum);
                double score = binScores.GetCount(PosLabel);
                scores.SetCount(label, score);
            }
            return(scores);
        }