예제 #1
0
        public double GetAccStdError(double confidenceLevel = 0.95)
        {
            double z   = StatsUtils.GetZScore(confidenceLevel);
            double acc = GetAccuracy();

            return(z * Math.Sqrt(acc * (1 - acc) / GetSumAll()));
        }
예제 #2
0
        public double GetAvgStdErr(string expName, string algoName, OrdinalPerfMetric metric, IEnumerable <LblT> orderedLabels, out double stderr, double confidenceLevel = 0.95)
        {
            double zval = StatsUtils.GetZScore(confidenceLevel);
            double stddev;
            double avg = GetAvg(expName, algoName, metric, orderedLabels, out stddev);

            stderr = zval * stddev / Math.Sqrt(GetFoldCount(expName, algoName));
            return(avg);
        }
예제 #3
0
        public double GetAvgStdErr(string expName, string algoName, ClassPerfMetric metric, LblT lbl, out double stderr, double confidenceLevel = 0.95)
        {
            double zval = StatsUtils.GetZScore(confidenceLevel);
            double stddev;
            double avg = GetAvg(expName, algoName, metric, lbl, out stddev);

            stderr = zval * stddev / Math.Sqrt(GetFoldCount(expName, algoName));
            return(avg);
        }
예제 #4
0
        // correction from wikipedia Krippendorff's Alpha
        public double GetKrippendorffsAlpha(IEnumerable <LblT> orderedLabels, Dictionary <LblT, Dictionary <LblT, double> > weights)
        {
            Preconditions.CheckNotNull(weights);
            LblT[] labels = orderedLabels as LblT[] ?? Preconditions.CheckNotNull(orderedLabels).ToArray();
            Preconditions.CheckArgument(!mLabels.Except(labels).Any());
            Preconditions.CheckArgument(!labels.Except(mLabels).Any());
            Preconditions.CheckArgument(StatsUtils.IsMatrixSymetrical(this));

            double denom = 0, numer = 0;

            for (int i = 0; i < labels.Length; i++)
            {
                for (int j = i + 1; j < labels.Length; j++)
                {
                    numer += Get(labels[i], labels[j]) * weights[labels[i]][labels[j]];
                    denom += SumRow(labels[i]) * SumCol(labels[j]) * weights[labels[i]][labels[j]];
                }
            }

            return(1 - (GetSumAll() - 1) * numer / denom);
        }